A buffer string / number question
Don M
Posts: 1,652
In a buffer that consists of 80 characters I have 9 of those characters that represent a number. In this case it is a 9 digit number- 000000001.
How do I convert these 9 characters into an actual number that I can use to do math or comparisons with?
I copy the 9 characters from the large buffer to the smaller buffer with this:
I tried this to display the number- debug.dec(@buffer2) and debug.dec(buffer2) and neither produced the result of 000000001 or 1.
If I do an index repeat from 0 to 8 with debug.dec(@buffer2) I get 484848484848484849 which is the decimal representation of each ASCII character.
I just want to display either 000000001 (with a fixed number of digits method) or just 1 as a number and not an ASCII equivalent.
Thanks.
How do I convert these 9 characters into an actual number that I can use to do math or comparisons with?
I copy the 9 characters from the large buffer to the smaller buffer with this:
bytemove(@Buffer2, @Work_Buffer[64], 9)
I tried this to display the number- debug.dec(@buffer2) and debug.dec(buffer2) and neither produced the result of 000000001 or 1.
If I do an index repeat from 0 to 8 with debug.dec(@buffer2) I get 484848484848484849 which is the decimal representation of each ASCII character.
I just want to display either 000000001 (with a fixed number of digits method) or just 1 as a number and not an ASCII equivalent.
Thanks.
Comments