
-----------------------------------
Azzy
Sat Nov 01, 2003 11:24 pm

Read/Write help
-----------------------------------
can someone tell me why this code isn't working?

open : fileNo, "IDS" , write
write : fileNo, ID, name
close : fileNo
open : fileNo, "IDS" , read, put
read : fileNo, ID
put : fileNo, ID
read : fileNo, name
put : fileNo, name
close : fileNo

-----------------------------------
StrikerMagazine
Sun Nov 02, 2003 12:01 am


-----------------------------------
Hm.. when you opened with fileNo for the second time, you said you were going to use it for both 'read' and 'put'.. i dont think you're allowed to do that.. every time you want to get from the file instead of output, you could close and reopen it. i guess so it would look like this
open : fileNo, "IDS" , write 
write : fileNo, ID, name 
close : fileNo 
open : fileNo, "IDS" , read
read : fileNo, ID 
close : fileNo
open : fileNo, "IDS", put
put : fileNo, ID 
close :fileNo
open :fileNo, "IDS",read
read : fileNo, name 
close : fileNo
open :fileNo, "IDS", put
put : fileNo, name 
close : fileNo

-----------------------------------
Tony
Sun Nov 02, 2003 12:54 am


-----------------------------------
I think there's a tutorial somewhere on reading/writing to a file.

you can also open the file for "search", and can find a point from which you want to read/write, instead of reopening the file.
