open output file with no name

Windows specific questions.
Post Reply
rvm
Posts: 7
Joined: Oct 08, 2017 3:34

open output file with no name

Post by rvm »

I inadvertently opened an output file without assigning a name to the output file variable.
Like:
Dim as string filename1
Open filename1 for output as #1

Compiling gave me no warning or error.
And it executed without error.
Did it actually create a file with no name that is using disk space? I see no evidence of it with dir or windows explorer. How can determine what the code actually did?
grindstone
Posts: 862
Joined: May 05, 2015 5:35
Location: Germany

Re: open output file with no name

Post by grindstone »

If you slightly change this snippet to

Code: Select all

Dim as string filename1
Print Open (filename1 for output as #1)
Sleep
you'll see that it retrurns error code 2, meaning "File not found". So no file will be created.
rvm
Posts: 7
Joined: Oct 08, 2017 3:34

Re: open output file with no name

Post by rvm »

grindstone, thank you for your reply. I should have thought to do that.
Post Reply