I am sure this is about the simplest question possible for b4ppc. I can't find in math or strings help, how to do this (string to number). I want to convert a string eg. "21.6" to an array integer (216).
I don't think the sub does it. I have a string, and I want an int16.
The string "21.6" then becomes the int16 216. I don't thin I can put
string types into an integer array.
The decimal point can easily be eliminated from the string but I put it
there in case a command may also handles that.
Basic4ppc automatically converts strings and numbers (floating point numbers) as needed.
If you want to convert a value to an integer you can use the Round keyword.
If you just want to remove the decimal point:
If I assign int16 matrix(0,0)=20.6 and then place matrix(0,0) in a text box, I get "20".
Whereas if I assign int16 matrix(0,0)=20.6*10, and place matrix(0,0) in a text box, I get "206", and if I place matrix(0,0)/10 in the text box, I get "20.6".
I haven't seen that before. I would expect errors. So I just needed the nerve to try it.