Prolem Loading Data From File

BlitzMax Forums/BlitzMax Beginners Area/Prolem Loading Data From File

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

But if he mixes WriteLine and WriteInt when creating the file then it can no longer be viewed or changed with a text editor.

A plain text file should have all data, including numbers, written with WriteLine. The same data is read back with ReadLine. This will produce string values, such as "25" for the number 25.

As mentioned, such strings can be cast to integer with Int( YourStringValue$ ).

Note that previous versions of Blitz would do this cast automatically when assigning a string value to an integer variable:

myInteger = "25"

This would set myInteger to the numeric value 25. But BlitzMax does not do this. You must explicitly use Int() to cast a string to an integer.