|
Post by bluatigro on Jul 11, 2018 8:47:04 GMT
i checked the errornr but i get strange results
on error goto [error] open "txt.txt" for input as #in close #in [skip] print "[ game over ]" end [error] if Err = 0 then ''catch file not exsists error close #in open "txt.txt" for output as #uit close #uit goto [skip] end if print Err , Err$ end
|
|
|
Post by tenochtitlanuk on Jul 11, 2018 10:30:13 GMT
You try to close a file which didn't exist, so was not open!
My variation of code is..
on error goto [error]
open "txt.txt" for input as #in c$=input$( #in, lof( #in)) print "'txt.txt' exists, content =<"; c$; ">" close #in
wait
[error] print Err , Err$
if Err = 0 then ''catch file not exsists error open "txt.txt" for output as #uit #uit "Created at "; time$(); close #uit print "File created with contents giving time." end if
end
|
|
|
Post by bluatigro on Jul 12, 2018 4:13:04 GMT
this is now what i wanted to do
on error goto [error] open "txt.txt" for input as #in print "read file" close #in [skip] print "[ game over ]" end [error] if Err = 0 then ''catch file not exsists error open "txt.txt" for output as #uit print "write file" close #uit goto [skip] end if print "error" print Err print Err$ end
|
|