splitting up an Array[s]
grasshopper
Posts: 438
I am trying to take a number from 0 - 100 and fill an array with it. i.e
How do i write a loop using a bit shif?
help me please...
long stringdata <------array long X <------varable Pub Start X = 100 loop: stringdata[noparse][[/noparse]0] := 1 stringdata := 0 stringdata := 0 end loop
How do i write a loop using a bit shif?
help me please...
Comments
2) There are no labels in Spin. Read the description of the REPEAT statement. This combines the FOR / NEXT loop and the DO / LOOP statements in Parallax Basic.
I want to do a repeat so that the variable X is broke up into an array named data
so that when the "repeat until" is done I will have this --> data [noparse][[/noparse] 0 ] = 1 and data [noparse][[/noparse] 1 ] = 0 and data [noparse][[/noparse] 2 ] = 0
Post Edited (grasshopper) : 3/7/2008 9:54:12 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 3/7/2008 11:12:34 PM GMT
All i want to do is put a three digit number like 100 into an array so that i can display this on my LCD screen. Why is it so hard to program the propeller. I figured i could do this but i have no such luck: Thank god you are all here...
but instead of using the out method, you would assign it to your·data array.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Plenty of scope to optimise the code there, but shown longhand for clarity.
If you want ascii characters in yourArray[noparse]/noparse rather than numbers ...
Post Edited (hippy) : 3/8/2008 2:48:32 PM GMT
I figured it out using both of your examples .