Notifications
Clear all
[Closed] problem with openFile command
Page 2 / 2
Prev
Sep 01, 2014 9:31 pm
could you elaborate with a simple example please? I’ve tried a few different things and nothing worked, even the simplest of the things fails so my guess is i’m doing something wrong…I’ve tried this:
theFile = "c:\ est3.txt"
createfile thefile
fileO =openfile thefile
close thefile
and also this:
theFile = "c:\ est3.txt"
createfile thefile
fileO =openfile thefile
close fileO
and even this
theFile = "c:\ est3.txt"
createfile thefile
close thefile
i either get undefined for the “fileO= openfile the file”
or “no close function for undefined” error…am I missing something?
thanks again for the patience…
Sep 01, 2014 9:31 pm
Close expects filestream, not string, so basically:
filename = "c:\ est.txt"
file = createFile filename
close file
deleteFile filename
Btw. when you are creating the file, you don’t need to (and shouldn’t) call openFile, the filestream is already returned by the createFile function.
1 Reply
Page 2 / 2
Prev