Notifications
Clear all

[Closed] problem with openFile command

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…

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
(@metamesh)
Joined: 11 months ago

Posts: 0

oookk got it working now, thanks so much for the explanation!!

Page 2 / 2