convert "42" to 42
BlitzMax Forums/BlitzMax Beginners Area/convert "42" to 42
| ||
Does anyone here know how I might do that? I'm trying to find the difference between a string 1 and an integer 1, but to no avail: Strict Local a:String= "1" Local b=1 Print a Print b Print Bin(a) Print Bin(b) |
| ||
print a[0] ' ascii value |
| ||
Not sure what you're asking, if you just want to convert a string to an Int, just cast the number like thisPrint Bin(Int(a)) If you want to know the ASCII value of the character "1" then use the Asc() command. Print Bin(Asc(a)) |
| ||
Ah that's right, strings are arrays. Thanks deps. I wouldn't have assumed printing it like you did would give me the ascii value. Huh. [edit] And TomToad, the Int(a) would actually be the best way to do it for my purposes. Thank you also. |