forums

TNT Basic Forums > Programming Q&A
unopenable files
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-11-2003 10:53

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

Hi,
At a fairly early stage of running my code I get the message:

*** Runtime exception caught ***
Line# : 699
Code : int fp = Open File(kLogFileName, false, kLogFileType)
Error : Could not open file.

The relevant code is:

Procedure EndGame()
set directory user preferences
int fp = Open File(kLogFileName, false, kLogFileType) 'Line 699
file write Time, kLogFileName
file write timer-startTime, kLogFileName
close file (fp)
blah, blah
end proc

As far as I know the syntax is correct, it also happens when I declare the variable as a global, and it happnes consistantly throughout. Needless to say, I don't get very far in testing the game.

Thanks in advance for any information you can provide,
Mark_667

07-11-2003 21:02

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Are you sure the file exists?

07-13-2003 12:52

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

D'oh!

It turns out that although, I created the file before I wrote to it, I called a procedure before that tried to write to it before it had been created. I put the code to create it at the start of my code (outside of any procedures) an it works.

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.