Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problem with Read File

Author
Message
Forest
18
Years of Service
User Offline
Joined: 29th May 2006
Location:
Posted: 26th Aug 2006 22:14
I am getting a recurrent problem when I try to run programs where the code requests a read from a text file.

I put in:

open to read 1,"data.txt"

I then have a text file (called data) saved in the same project folder as the main source file.

But then when I run the program, it crashes and I get the error message:

File does not exist at line (whatever line number of open to read)

Sometimes programs will work, sometimes not. It seems to depend on if you have edited the text file and resaved it or something like that. Sometimes it doesnt even work with a new text file.
Is this a bug or am I doing something wrong?
I know the file does exist cos I can see it on my system.
FROGGIE!
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 27th Aug 2006 16:42
Check that the file is in the right directory, for example if it is in a folder called 'data' the you will need to use


Quote: "It seems to depend on if you have edited the text file and resaved it or something like that. Sometimes it doesnt even work with a new text file."


Make sure that if you edit it you dont change the extension, make sure that when you save it you select the .txt extension.

Login to post a reply

Server time is: 2024-09-25 07:25:12
Your offset time is: 2024-09-25 07:25:12