forums

TNT Basic Forums > Beyond Basic
File handling
< Last Thread     Next Thread >
Author
Thread        Post A Reply

04-07-2003 08:41

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Hi,
About TNT's file handling, if a text or data file from a previous game(that has been created and used by TNT) has a player's score, etc on can this be overwritten without accidentally using old data the next time it is referenced? How do you know TNT won't access the old data?
Does this mean the file is wiped of it's data after every complete run of the programme, and if so, what about any saved user settings? Me confused! :(

thanks,
mark_667

04-28-2003 05:09

Posted by:
Freefall

Click Here to Email Freefall   Find more posts by Freefall

I'm not actually sure whta it is that you're saying, but it sounds like you're talking about an newer version using and older versions file.

If thats the case, why dont you just make the first line of the file the version of the app that wrote it? That way, if the app that reads it is newer than the one that wrote it, it can create a new file, or keep the old one, depending.

04-28-2003 08:52

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Thanks for the suggestion, but what if it's a newer game made with the same app? I suppose I could write a variable to it that increments every time the game is run, but...

04-28-2003 22:36

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

I don't see any problem! If the data is differet from one version to the other, use the version line. If not, then you can use the same file?!?

04-29-2003 08:01

Posted by:
Freefall

Click Here to Email Freefall   Find more posts by Freefall

Nah, you mis-understood me. Give your game a version. Lets say you game is version 1.23.6. You built it using TNT 1.12.
The first line that you write to your prefs file would be 1.23.6, not TNT's version but your apps. Next time you update your game and build, still using TNT v.1.12, make it check whether the line reads 1.23.9, so you know its either the same version or an older one that wrote the file. You don't need to worry about TNT's version at all.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.