<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic GDL IN/OUT and Arrays in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200597#M14460</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Trying to update our zone GDL to automatically calculate occupancy numbers using use tables from the Building Code. I'm using an external text file to hold the table data so that it can be updated if the Building Code changes.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;
!-- Getting NCC Table D1.13 values &lt;BR /&gt;
&lt;BR /&gt;
dim value_use[], value_rate[] &lt;BR /&gt;
&lt;BR /&gt;
filename= "NCCTableD113.txt" &lt;BR /&gt;
ch1=OPEN("TEXT",filename,"SEPARATOR='\t',MODE=RO,LIBRARY") &lt;BR /&gt;
&lt;BR /&gt;
   !--counting the total number of rows &lt;BR /&gt;
	row=0&lt;BR /&gt;
	do &lt;BR /&gt;
		row= row+1 &lt;BR /&gt;
		n=INPUT(ch1,row,1,string1) &lt;BR /&gt;
	while n&amp;gt;-1 &lt;BR /&gt;
&lt;BR /&gt;
   !--reading the first column for NCC_TableD113_Use &lt;BR /&gt;
   for k= 1 to row-1 &lt;BR /&gt;
      n=INPUT(ch1,k,1,string1) &lt;BR /&gt;
      value_use&lt;K&gt;= string1 &lt;BR /&gt;
   next k &lt;BR /&gt;
&lt;BR /&gt;
   !--reading the second column for NCC_TableD113_Rate &lt;BR /&gt;
   for m= 1 to row-1 &lt;BR /&gt;
      n=INPUT(ch1,m,2,string2) &lt;BR /&gt;
      value_rate&lt;M&gt;= string2 &lt;BR /&gt;
   next m &lt;BR /&gt;
&lt;BR /&gt;
CLOSE (ch1) &lt;BR /&gt;
&lt;BR /&gt;
VALUES "NCC_TableD113_Use" value_use, custom 
&lt;/M&gt;&lt;/K&gt;&lt;/BLOCKQUOTE&gt;

Not having done much work yet with arrays I'm now stuck as to the next step to use the value the user selects from the drop down for NCC_TableD113_Use to select the matching value for the NCC_TableD113_Rate.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone suggest some code or point me in the right direction for a guide for this?&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 Oct 2012 23:36:47 GMT</pubDate>
    <dc:creator>Matthew Johnson</dc:creator>
    <dc:date>2012-10-04T23:36:47Z</dc:date>
    <item>
      <title>GDL IN/OUT and Arrays</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200597#M14460</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Trying to update our zone GDL to automatically calculate occupancy numbers using use tables from the Building Code. I'm using an external text file to hold the table data so that it can be updated if the Building Code changes.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;
!-- Getting NCC Table D1.13 values &lt;BR /&gt;
&lt;BR /&gt;
dim value_use[], value_rate[] &lt;BR /&gt;
&lt;BR /&gt;
filename= "NCCTableD113.txt" &lt;BR /&gt;
ch1=OPEN("TEXT",filename,"SEPARATOR='\t',MODE=RO,LIBRARY") &lt;BR /&gt;
&lt;BR /&gt;
   !--counting the total number of rows &lt;BR /&gt;
	row=0&lt;BR /&gt;
	do &lt;BR /&gt;
		row= row+1 &lt;BR /&gt;
		n=INPUT(ch1,row,1,string1) &lt;BR /&gt;
	while n&amp;gt;-1 &lt;BR /&gt;
&lt;BR /&gt;
   !--reading the first column for NCC_TableD113_Use &lt;BR /&gt;
   for k= 1 to row-1 &lt;BR /&gt;
      n=INPUT(ch1,k,1,string1) &lt;BR /&gt;
      value_use&lt;K&gt;= string1 &lt;BR /&gt;
   next k &lt;BR /&gt;
&lt;BR /&gt;
   !--reading the second column for NCC_TableD113_Rate &lt;BR /&gt;
   for m= 1 to row-1 &lt;BR /&gt;
      n=INPUT(ch1,m,2,string2) &lt;BR /&gt;
      value_rate&lt;M&gt;= string2 &lt;BR /&gt;
   next m &lt;BR /&gt;
&lt;BR /&gt;
CLOSE (ch1) &lt;BR /&gt;
&lt;BR /&gt;
VALUES "NCC_TableD113_Use" value_use, custom 
&lt;/M&gt;&lt;/K&gt;&lt;/BLOCKQUOTE&gt;

Not having done much work yet with arrays I'm now stuck as to the next step to use the value the user selects from the drop down for NCC_TableD113_Use to select the matching value for the NCC_TableD113_Rate.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone suggest some code or point me in the right direction for a guide for this?&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Oct 2012 23:36:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200597#M14460</guid>
      <dc:creator>Matthew Johnson</dc:creator>
      <dc:date>2012-10-04T23:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: GDL IN/OUT and Arrays</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200598#M14461</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
If you are just filling the NCC_TableD113_Rate with the chosen NCC_TableD113_Use then &lt;BR /&gt;
this should do the job.&lt;BR /&gt;
&lt;BR /&gt;
Two parameters needed; NCC_TableD113_Use (string) and NCC_TableD113_Rate (number)&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;!-- Getting NCC Table D1.13 values 

dim value_use[], value_rate[] 

filename= "NCCTableD113.txt" 
ch1=OPEN("TEXT",filename,"SEPARATOR='\t',MODE=RO,LIBRARY") 

!--counting the total number of rows
do
row= row+1
n=INPUT(ch1,row,1,string1)
while n&amp;gt;-1

!--reading the first column for NCC_TableD113_Use
for k= 1 to row-1
	n=INPUT(ch1,k,1,string1)
	value_use&lt;K&gt;= string1
next k
values "NCC_TableD113_Use" value_use, custom

!--reading the second column for NCC_TableD113_Rate 
for k= 1 to row-1
	n=INPUT(ch1,k,1,string1,string2)
	if NCC_TableD113_Use = string1 then
		values "NCC_TableD113_Rate" string2
	endif
next k

CLOSE (ch1)
&lt;/K&gt;&lt;/PRE&gt;

&lt;BR /&gt;
Hope this works.&lt;BR /&gt;
&lt;BR /&gt;
PS. What kind of a boat are you sailing?</description>
      <pubDate>Sat, 06 Oct 2012 18:33:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200598#M14461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-06T18:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: GDL IN/OUT and Arrays</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200599#M14462</link>
      <description>Juha,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the assist. Works well and simple code keeps it tidy.&lt;BR /&gt;
&lt;BR /&gt;
PS: the avatar is the sail from my Cobra catamaran. Don't get to sail it much since I had my ankle reconstructed. Spend most of my spare time now teaching kids to sail.</description>
      <pubDate>Sun, 07 Oct 2012 23:13:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200599#M14462</guid>
      <dc:creator>Matthew Johnson</dc:creator>
      <dc:date>2012-10-07T23:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: GDL IN/OUT and Arrays</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200600#M14463</link>
      <description>Nice to hear that the problem was solved. &lt;BR /&gt;
&lt;BR /&gt;
Sorry about the ankle...as they say: "keelboats are for elderly&lt;BR /&gt;
people" &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
Regards, Juha</description>
      <pubDate>Mon, 08 Oct 2012 16:48:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/GDL-IN-OUT-and-Arrays/m-p/200600#M14463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-08T16:48:15Z</dc:date>
    </item>
  </channel>
</rss>

