open output file with no name

Windows specific questions.
rvm
Posts: 2
Joined: Oct 08, 2017 3:34

open output file with no name

Postby rvm » Aug 30, 2019 7:45

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: 721
Joined: May 05, 2015 5:35
Location: Germany

Re: open output file with no name

Postby grindstone » Aug 31, 2019 15:04

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: 2
Joined: Oct 08, 2017 3:34

Re: open output file with no name

Postby rvm » Aug 31, 2019 17:04

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

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 2 guests