<?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 Re: Loop and lines question in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232468#M11096</link>
    <description>Ilder beat me to it.&lt;BR /&gt;
I had a blackout just as I was about to post.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cry.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
    <pubDate>Fri, 19 Dec 2014 12:14:03 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2014-12-19T12:14:03Z</dc:date>
    <item>
      <title>Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232462#M11090</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi, &lt;BR /&gt;
&lt;BR /&gt;
Sorry for my newbie question but I can't find solution for my case:&lt;BR /&gt;
&lt;BR /&gt;
I need to draw a line beetween two points given by a loop:&lt;BR /&gt;

&lt;PRE&gt;For k=0 TO 2 STEP 1

x= 5 * k
y= 10  * k

NEXT k&lt;/PRE&gt;

So the effect would be two sets of values for X and Y :&lt;BR /&gt;
x1 = 5&lt;BR /&gt;
y1= 10&lt;BR /&gt;
&lt;BR /&gt;
x2= 10&lt;BR /&gt;
y2= 20&lt;BR /&gt;
&lt;BR /&gt;
And I want a line beetween x1, y2, x2, y2&lt;BR /&gt;

&lt;PRE&gt;line2 5,10,10,20 !!!! or ...
line2 x,y,x,y&lt;/PRE&gt;

How am I supposed to get those x1, y1, x2 and y2 ?&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Dec 2014 08:34:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232462#M11090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-18T08:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232463#M11091</link>
      <description>I am not sure why exactly you want to do this but what you want is this...&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;DIM x []
DIM y []

For k=1 TO 2

x&lt;K&gt;= 5 * k 
y&lt;K&gt;= 10 * k 

NEXT k


line2 x[1],y[1],x[2],y[2]&lt;/K&gt;&lt;/K&gt;&lt;/PRE&gt;

&lt;BR /&gt;
Because your values for x &amp;amp; y are changing and you can't draw your line until you know both values you need to store them somewhere -  and one method is in an array as I have done above.&lt;BR /&gt;
&lt;BR /&gt;
Another way would be to PUT the values into a buffer and then GET them when you need them...&lt;BR /&gt;

&lt;PRE&gt;x = 0
y = 0

For k=1 TO 2

x= 5 * k 
y= 10 * k 

PUT x,y

NEXT k


line2 GET(NSP)&lt;/PRE&gt;

Barry.</description>
      <pubDate>Thu, 18 Dec 2014 08:49:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232463#M11091</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2014-12-18T08:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232464#M11092</link>
      <description>Hey Barry, thanks !&lt;BR /&gt;
&lt;BR /&gt;
It works.&lt;BR /&gt;
&lt;BR /&gt;
Quick question - if I would like to use for several times sets of x,y values can I use the PUT GET buffer system  of only the array method ?&lt;BR /&gt;
&lt;BR /&gt;
For the moment it looks like for me that after using once the value from buffer it is deleted from there...&lt;BR /&gt;
&lt;BR /&gt;
In other words is it poosible to do this ? :
&lt;PRE&gt;x = 0 
y = 0 

For k=1 TO 2 

x= 5 * k 
y= 10 * k 

PUT x,y 

NEXT k 

line2 GET(1), GET(1), GET(1), GET(1)  ! ----- First line x1, y1, x2, y2,
line2 0, 0, GET(1), GET(1)  ! ----- Second line 0,0, x1, y1
line2 GET(1), GET(1), 0,0  ! ----- Third line x2, y2, 0, 0&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Dec 2014 10:24:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232464#M11092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-19T10:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232465#M11093</link>
      <description>Hy,&lt;BR /&gt;
GET will give you a value from the buffer removing it,&lt;BR /&gt;
USE will acces the value but not delete it from the buffer.&lt;BR /&gt;
&lt;BR /&gt;
In your case the array method is much more efficient because the buffer is a first in first out container and you can't read the second number without reading the first one.</description>
      <pubDate>Fri, 19 Dec 2014 10:35:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232465#M11093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-19T10:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232466#M11094</link>
      <description>&lt;BLOCKQUOTE&gt;Ilder wrote:&lt;BR /&gt;Hy,&lt;BR /&gt;
In your case the array method is much more efficient because the buffer is a first in first out container and you can't read the second number without reading the first one.&lt;/BLOCKQUOTE&gt;

And this the answer to my next question, thanks !</description>
      <pubDate>Fri, 19 Dec 2014 11:40:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232466#M11094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-19T11:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232467#M11095</link>
      <description>GET will take the value from the buffer so it can only be used once.&lt;BR /&gt;
However USE will leave the value in the buffer so it can be used again.&lt;BR /&gt;
&lt;BR /&gt;
The problem is the buffer values must be used in the order that they are put in there.&lt;BR /&gt;
So you would have to use some values, then use them again and discard them to use the next values that you need - could get very messy.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This is where the array is much better.&lt;BR /&gt;
The values are stored in the array and can be used over and over and you can pick and choose easily which values you want to use.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;DIM x [] 
DIM y [] 

For k=1 TO 2 

x&lt;K&gt;= 5 * k 
y&lt;K&gt;= 10 * k 

NEXT k 


line2 x[1], y[1], x[2], y[2]  ! ----- First line x1, y1, x2, y2, 
line2 0, 0, x[1], y[1]  ! ----- Second line 0,0, x1, y1 
line2 x[2], y[2], 0,0  ! ----- Third line x2, y2, 0, 0&lt;/K&gt;&lt;/K&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Dec 2014 12:11:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232467#M11095</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2014-12-19T12:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232468#M11096</link>
      <description>Ilder beat me to it.&lt;BR /&gt;
I had a blackout just as I was about to post.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cry.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 19 Dec 2014 12:14:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232468#M11096</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2014-12-19T12:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232469#M11097</link>
      <description>&lt;BLOCKQUOTE&gt;Barry wrote:&lt;BR /&gt;I had a blackout just as I was about to post.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cry.gif" style="display : inline;" /&gt;&lt;/BLOCKQUOTE&gt;
Electrical or neurological?&lt;BR /&gt;
&lt;BR /&gt;
 &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Fri, 19 Dec 2014 13:51:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232469#M11097</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2014-12-19T13:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loop and lines question</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232470#M11098</link>
      <description>&lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" style="display : inline;" /&gt; &lt;BR /&gt;
Power blackout fortunately.&lt;BR /&gt;
&lt;BR /&gt;
Self induced blackouts might be on the cards though seeing as I am on my Christmas break now.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Sun, 21 Dec 2014 01:54:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Loop-and-lines-question/m-p/232470#M11098</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2014-12-21T01:54:58Z</dc:date>
    </item>
  </channel>
</rss>

