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.

DarkBASIC Discussion / File Reading

Author
Message
code master
21
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 18th Mar 2006 15:26
I make a file, like so:

Then i open it to read:


Then i open it to write:



And i get an error message:


Any ideas as to why?
all i want to do, is make a file if it dosen't exist, and read from it and right to it.

later

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 18th Mar 2006 16:11
Db classic can`t write to a file that exists.


Area 51
19
Years of Service
User Offline
Joined: 3rd Feb 2006
Location: UNKNOWN
Posted: 18th Mar 2006 16:30
So you need to delete the file first and then make a new one

No Aliens Here!
General Sephiro
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location:
Posted: 18th Mar 2006 16:43 Edited at: 18th Mar 2006 16:44
If Only writing to it once

If Writing to the file more than once

When you open to write, DBC automatically creates the file for you so you don't have to type if file exist=0 then make file...

As AREA 51 has explained

code master
21
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 19th Mar 2006 00:03
Ok, thanks for the input!
So, to add information to a file, I need to read it in, store it, close the file, open to write, write old data + new data?
That seems a little long winded.
Oh well, if i must...


later

Login to post a reply

Server time is: 2025-05-23 18:51:02
Your offset time is: 2025-05-23 18:51:02