Parsing string into array. Please... please help.
mrgosh
Posts: 23
Alright.
Heres what I gotta do within the next 16 hours:
1. Determine length of numeric variable and read each digit of variable into a unique index position of an array. The variable will be anywhere from 6 to 24 digits long.
for example.
if myVar = 25365820 then
lengthVar= 8 and
my array =
myArray(0) = 2
myArray(1) = 5
myArray(2) = 3
myArray(3) = 6
myArray(4) = 5
so on and so forth.
If anybody has any ready made code or any help as far as doing this, it would be greatly appreciated (I'll mail you $5 for a beer).
I'm ok with leaving positions at the end of the array null if say, a 9 digit number is parsed into a 12 position array. Also, this information will change dozens of times during each use of the program, so I think EEPROM is out of the question no?
Thanks for reading and in advance for the help.
hearts,
-Mike
Heres what I gotta do within the next 16 hours:
1. Determine length of numeric variable and read each digit of variable into a unique index position of an array. The variable will be anywhere from 6 to 24 digits long.
for example.
if myVar = 25365820 then
lengthVar= 8 and
my array =
myArray(0) = 2
myArray(1) = 5
myArray(2) = 3
myArray(3) = 6
myArray(4) = 5
so on and so forth.
If anybody has any ready made code or any help as far as doing this, it would be greatly appreciated (I'll mail you $5 for a beer).
I'm ok with leaving positions at the end of the array null if say, a 9 digit number is parsed into a 12 position array. Also, this information will change dozens of times during each use of the program, so I think EEPROM is out of the question no?
Thanks for reading and in advance for the help.
hearts,
-Mike
Comments
·· I'll try to help you help yourself...EEPROM is not a good idea for constantly updating data.· But with an array of up to 24 bytes, you will really need to use a Stamp with Scratchpad RAM, otherwise you'll be using up all the available variable space for your array (Minus 2 bytes).··You will really need a BS2e, BS2sx, BS2p, BS2pe·or BS2px to perform this task.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com