arrays..how to question.
Joe M
Posts: 45
I need a little basic help(hah!)...
So If I want to define an array and then loop through it, is that possible in pbasic?
i.e.
foo=[noparse][[/noparse]"cat","dog","bird","fish"]
for loop = 1 to 4
debug "foo[noparse][[/noparse]loop]",cr
next
Which leads into my next question, can you reverse and array, or loop through it backwards?
thanks!
-Joe
So If I want to define an array and then loop through it, is that possible in pbasic?
i.e.
foo=[noparse][[/noparse]"cat","dog","bird","fish"]
for loop = 1 to 4
debug "foo[noparse][[/noparse]loop]",cr
next
Which leads into my next question, can you reverse and array, or loop through it backwards?
thanks!
-Joe
Comments
·· You are attempting to create an array with string variables which is not a supported variable type on the BASIC Stamps.· You can create an array of bytes and index it within a loop, but not the way you are showing.· What are you trying to accomplish, perhaps there is an easier way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
So... I'd like to set something/a variable to hold values like "111111000000", "11111100000", "111111110000"... and then loop through it with OUTS = %variable[noparse][[/noparse]x]
Does that sound possible or am I totally off base?
Thanks,
-Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax