Packing an array into a varable or string help
grasshopper
Posts: 438
I want to know how to pack and array into an variable.
This is not working but I think i am close. Perhaps some bit shifting or something?
My All_stats variable should contain the string 0--X when done.
Var Byte Stats long All_stats pub main STATS[noparse][[/noparse] 0 ] := "0" '$30 OR $31 STATS[noparse][[/noparse] 1 ] := "-" '$2B OR 2D STATS[noparse][[/noparse] 2 ] := "-" '$2B OR 2D STATS[noparse][[/noparse] 3 ] := "X" '$43 OR $53 All_Stats := Stats[noparse][[/noparse]0] & Stats & Stats & Stats
This is not working but I think i am close. Perhaps some bit shifting or something?
My All_stats variable should contain the string 0--X when done.
Comments
You could also use the bit operator (|<) to generate a single bit from a bit number so |<0 is the same as %0001 and |<1 is the same as %0010, etc.