BBC BASIC for Windows
Programming >> Database and Files >> Writing multiple variables to a file http://bb4w.conforums.com/index.cgi?board=database&action=display&num=1381755409 Writing multiple variables to a file
Post by johnblack on Oct 14th, 2013, 12:56pm
I am trying to use this code to write multiple user inputs to a file:
If only takes in the PoneName$ variable and tends to make random workds out of my other variables (which are derived from random numbers. Re: Writing multiple variables to a file
Post by admin on Oct 14th, 2013, 1:47pm
IIf only takes in the PoneName$ variable and tends to make random workds out of my other variables (which are derived from random numbers.
It's doing what it should, but you won't be able to read the (binary) numeric values in a text editor. If you read the values back in from the file it will work fine:
Incidentally I don't recommend omitting the file extension, because a '.BBC' extension will be added automatically and the resulting file could easily be mistaken for a program. Better to choose a more appropriate extension, e.g:
Code:
A=OPENOUT "PlayerAttribute.dat"
Richard.
Re: Writing multiple variables to a file
Post by johnblack on Oct 14th, 2013, 2:20pm
Awesome! Thank you for all your help. You have taught me all I already know about BBC basic through your manual, which is really very thorough.
I am developing a scheme of work for some year 8 students, if you want it when I am finished you are welcome to a copy.