Okay, if i create a file using the Make File command, then use the Open To Write command, it doesn't open the file correctly.
I have coded in some error catching and the file is created, but not opened to write.
Code:
a$=""
do
Rem make the file
make file "newfile.txt"
wait 1000
Rem make sure the file exsists
if file exist ("newfile.txt")=1
open to write 1,"newfile.txt"
else
print "ERROR: File does not exist 'newfile.txt'"
endif
Rem make sure the file is open
if file open (1)=1
write string 1,"Hello World!"
else
print "ERROR: file failed to open to write."
endif
Rem self explanitory ;D
close file 1
wait 1000
open to read 1,"newfile.txt"
Rem make sure the file is open
if file open(1)=1
read string 1,a$
print a$
else
print "ERROR: file failed to open to read."
endif
Rem close file
close file 1
Rem delete file, if I made it so the program writes differnt text based on a variable
Rem I would need to re-created the file to get it to work
delete file "newfile.txt"
loop
end
Any help would be much appreciated