|
Post by asmodeus on Oct 14, 2010 17:06:39 GMT -5
Hi All,
Sorry for a dumb question, but how can I convert a string variable to an integer variable?
for example:
file = OpenFileRead ("save.dat") line1$ = ReadLine (file) -- this is a numeric value but if I try using ReadInt, ReadByte or ReadChar it returns a number but not whats in the file its reading from.
Thanks, Asmodeus
|
|
|
Post by matthew on Oct 14, 2010 18:14:37 GMT -5
You need to be using the Val command. You'll find it documented in the Programmer's Guide. I've created a short program which will show you a way of using it to read from a file, you can download it here.
|
|
|
Post by asmodeus on Oct 14, 2010 19:39:43 GMT -5
Awesome. Thx Matthew I never noticed that Val function. Also, thx for the example it really helps.
-Asmodeus
|
|