Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Gilbert on Mon 15/03/2004 02:42:22

Title: Suggestion: FileWrite[Int]() return values
Post by: Gilbert on Mon 15/03/2004 02:42:22
Sorry, I may not have checked thoroughly, but seems that there aren't much error handling when writting to a file (with FileWrite() or FileWriteInt() functions).

I'm not sure but I think the game will crash if there's a read/write error when dealing with external files (like diskfull while appending to a file).

My suggestion is that the FileWrite[Int]() functions return 0 if sucessful and nonzero if there's an erroe (if it hadn't been implemented already, but nothing was written in the manual about it, so...)

It'll be good if the FileRead functions can have this kind of error handling too.
Title: Re:Suggestion: FileWrite[Int]() return values
Post by: RickJ on Mon 15/03/2004 19:32:24
I can second the need for error handling.  The problem with doing this for FileREad functions is that most of them already return a data value.  The FileIsEOF() function was added to be able to know when to stop reading a file.      Perhaps a FileIsError() or similar funct could be added to check for errors while reading or writing?
Title: Re:Suggestion: FileWrite[Int]() return values
Post by: Pumaman on Mon 15/03/2004 20:31:38
Yes, some sort of FileIsError function sounds like the best idea here, rather than returning a value from loads of different functions. I'll add it to my list.