@Oscar, Help! I need your expertise. How can I ask for an input of a binary string, then convert that into an array for each bit? The problem is using the length as a $tring isn't compatible with integers!
Hmm, I did'nt know about the VAL command. I just want to ask for an unfixed length binary .. number, ie:(10101 OR 0110), then it turns that into BIT[0]=1:BIT[1]=0 and so forth.
Now I understand. You wanted to trim the "0" from the left side.
There is an easy way to have an string with exact length of a binary. Try this:
SIZE$=BIN$(VAL("&B"+SIZE$))
? LEN(SIZE$)
The code above is used to get the string without the 0 at the left side. The text &B at the begining of the argument is used to identify the string as a binary.
I'm sorry for not answering. I see you've gotten some help already, but I think I can still contribute a bit. :)
If you want an array that holds each bit from a binary string, without trimming any leading zeroes, you could make something like this...
DIM BNRY[0]
FOR I=0 TO LEN(ST$)-1
PUSH BNRY,VAL(ST$[I])
NEXT
Just make sure to validate that the string only contains binary digits.