Catching errors when readin ints from file

Started by chucklas, Thu 24/07/2014 00:59:32

Previous topic - Next topic

chucklas

I am curious if it is possible to catch errors when reading ints from a file.  I have a file where i save the time played.  If someone tries to edit the file and then play the game, it causes the came to crash when reading the time played back from the file.  If possible i would like to just delete the file if there is an error when reading the ints instead of having the game crash.  I can't find anyway to do this.  Is it possible or am I just out of luck?

Khris

You don't have to rely on AGS's file int functions, you can write and read raw characters.
Just make up your own format, best using some simple encryption. Then read it back and parse it yourself.

chucklas

yeah, fair enough.  I was hoping to have some type of try/catch but I totally understand not implementing that in ags. 

SMF spam blocked by CleanTalk