08-01-2003, 04:41 AM
08-01-2003, 04:44 AM
Easy way? I don't quite understand you, but I'll try to guess.
The easiest way to save game data is opening a text file with OPEN "file" FOR OUTPUT AS #filenumber, and then putting important variables in it using PRINT #filenumber, variable. Don't forget to CLOSE #filenumber when you're done.
To load, just OPEN "file" FOR INPUT AS #filenumber, and get those variables from the file using INPUT #filenumber, variable. Don't forget to CLOSE #filenumber.
For more info, check QB help and try to be more specific in your next post, just to point me in the direction where I should help you
The easiest way to save game data is opening a text file with OPEN "file" FOR OUTPUT AS #filenumber, and then putting important variables in it using PRINT #filenumber, variable. Don't forget to CLOSE #filenumber when you're done.
To load, just OPEN "file" FOR INPUT AS #filenumber, and get those variables from the file using INPUT #filenumber, variable. Don't forget to CLOSE #filenumber.
For more info, check QB help and try to be more specific in your next post, just to point me in the direction where I should help you
08-01-2003, 04:46 AM
ok... that just wat i wontd to know
08-01-2003, 05:33 AM
The easiest way is to use get and put, but that advice only applies if you know exactly what you'll be saving and loading. INPUT/OUTPUT is a lot easier to manipulate if you decide to add something later or change the format..
08-01-2003, 11:12 PM
Why dont u create a type containing all the variables and just PUT it in a binary file and then when u require to retrieve it just GET it from the file in the same variable like this:
Type typgame
score as integer
...
...
...
End Type
DIM gm AS typgame
gm.score = 1000
gm.... = ...
'To put
OPEN "game.bin" FOR BINARY AS #1
PUT #1, gm
CLOSE #1
'To get
OPEN "game.bin" FOR BINARY AS #1
GET #1, gm
CLOSE #1
P.S: I am sleepy right now so just take this code as a guide line 8)
Type typgame
score as integer
...
...
...
End Type
DIM gm AS typgame
gm.score = 1000
gm.... = ...
'To put
OPEN "game.bin" FOR BINARY AS #1
PUT #1, gm
CLOSE #1
'To get
OPEN "game.bin" FOR BINARY AS #1
GET #1, gm
CLOSE #1
P.S: I am sleepy right now so just take this code as a guide line 8)