<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0">
<channel>
    <title>RoboRealm Forum</title>
    <link>http://www.RoboRealm.com/</link>
    <description>The newest forum threads.</description>
    <lastBuildDate>Tue, 30 Nov 1999 00:11:00 EST</lastBuildDate>
    <language>en-us</language>
    <copyright>Copyright: (C) RoboRealm, http://www.RoboRealm.com/</copyright>
    <docs>http://www.RoboRealm.com/</docs>

    <item>
        <title>No Title</title>
        <description>
        Ben,&lt;br&gt;&lt;br&gt;Where does the &quot;list&quot; come from? You are missing a GetArrayVariable.&lt;br&gt;&lt;br&gt;You would also need a check based on the last element otherwise this array would increase very quickly in size even in a single trigger press (humans are much slower than machines).&lt;br&gt;&lt;br&gt;trigger=GetVariable(&quot;trigger&quot;) &lt;br&gt;X_AXIS=GetVariable(&quot;X_AXIS&quot;) &lt;br&gt;&lt;br&gt;if trigger=1 then &lt;br&gt;&amp;nbsp;&amp;nbsp;list = GetArrayVariable(&quot;my_list&quot;)&lt;br&gt;&amp;nbsp;&amp;nbsp;size = ubound(list)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if list(size) &amp;lt;&amp;gt; X_AXIS then&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ReDim list(size+1) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list(size+1) = X_AXIS&lt;br&gt;&amp;nbsp;&amp;nbsp;end if&lt;br&gt;&amp;nbsp;&amp;nbsp;SetArrayVariable &quot;my_list&quot;, list&lt;br&gt;end if &lt;br&gt;&lt;br&gt;&lt;br&gt;You will get an extra 0 as the first number but you can just ignore that. If the array does not exist the GetArrayVariable will create an array with a single element of zero.&lt;br&gt;&lt;br&gt;STeven.&lt;br&gt;        </description>
        <link>http://www.roborealm.com/forum/index.php?thread_id=4315</link>
        <guid>http://www.roborealm.com/forum/index.php?thread_id=4315</guid>
        <pubDate>Tue, 30 Nov 1999 00:11:00 EST</pubDate>
    </item>
    <item>
        <title>No Title</title>
        <description>
        Thank you very much STeven that works perfectly.&lt;br&gt;&lt;br&gt;One more array question.&amp;nbsp;&amp;nbsp;I want to store the values of a joystick into an array every time I press the button on the joystick.&amp;nbsp;&amp;nbsp;I want this array to be dynamic so I can store 1 value or X values.(Just wondering what is the maximum size of an array in RR?).&amp;nbsp;&amp;nbsp;I have tried using ReDim and Preserve but have had no luck.&amp;nbsp;&amp;nbsp;This is what I thought would work but has been unsuccessful:&lt;br&gt;&lt;br&gt;trigger=GetVariable(&quot;trigger&quot;)&lt;br&gt;X_AXIS=GetVariable(&quot;X_AXIS&quot;)&lt;br&gt;&lt;br&gt;&lt;br&gt;ReDim list(i)&lt;br&gt;if trigger=1 then&lt;br&gt;i=i+1&lt;br&gt;list(X_AXIS)&lt;br&gt;else&lt;br&gt;i=i&lt;br&gt;end if&lt;br&gt;&lt;br&gt;So every time the button(trigger) is pressed the array increases by 1 and makes the new entry the current value of the X_AXIS.&lt;br&gt;&lt;br&gt;Thank you very much,&lt;br&gt;&lt;br&gt;-Ben&lt;br&gt;&lt;br&gt;&lt;br&gt;        </description>
        <link>http://www.roborealm.com/forum/index.php?thread_id=4315</link>
        <guid>http://www.roborealm.com/forum/index.php?thread_id=4315</guid>
        <pubDate>Tue, 30 Nov 1999 00:11:00 EST</pubDate>
    </item>
    <item>
        <title>No Title</title>
        <description>
        Ben,&lt;br&gt;&lt;br&gt;Perhaps the following would work?&lt;br&gt;&lt;br&gt;list = GetArrayVariable(&quot;my_list&quot;)&lt;br&gt;&lt;br&gt;if isArray(list) and ubound(list) &amp;gt; 0 then&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;top = ubound(list)&lt;br&gt;&amp;nbsp;&amp;nbsp;for i = 0 to ubound(list)/2&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;t = list(i)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list(i) = list(top)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list(top) = t&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;top = top - 1&lt;br&gt;&amp;nbsp;&amp;nbsp;next&lt;br&gt;&lt;br&gt;end if&lt;br&gt;&lt;br&gt;SetArrayVariable &quot;my_list&quot;, list&lt;br&gt;&lt;br&gt;The trick here is that the first and last element are just swapped ... which allows you to do an in-place reversal.&lt;br&gt;&lt;br&gt;STeven.        </description>
        <link>http://www.roborealm.com/forum/index.php?thread_id=4315</link>
        <guid>http://www.roborealm.com/forum/index.php?thread_id=4315</guid>
        <pubDate>Tue, 30 Nov 1999 00:11:00 EST</pubDate>
    </item>
    <item>
        <title>Working with Arrays</title>
        <description>
        STeven-&lt;br&gt;&lt;br&gt;I was wondering what would be the best way to store and reverse an array in RR?&amp;nbsp;&amp;nbsp;I was thinking about using the &quot;WRITE VARIABLE&quot; module but the accuracy is too low.&amp;nbsp;&amp;nbsp;For example, I want to store motor values &quot;255,255,255,0,255,0,0&quot; and then reverse the array to read out &quot;0,0,255,0,255,255,255&quot;.&amp;nbsp;&amp;nbsp;I was trying to use FOR loops in the VBSCRIPT module but have had little success. &lt;br&gt;&lt;br&gt;Any help would be greatly appreciated,&lt;br&gt;&lt;br&gt;-Ben        </description>
        <link>http://www.roborealm.com/forum/index.php?thread_id=4315</link>
        <guid>http://www.roborealm.com/forum/index.php?thread_id=4315</guid>
        <pubDate>Tue, 30 Nov 1999 00:11:00 EST</pubDate>
    </item>
</channel>
</rss>
