"Bad File Name or Number" (Error 52) If CANCEL "LPT1: PROMPT" (42361)
This article was previously published under Q42361
SUMMARY
OPENing the "LPT1:PROMPT" device name as #n in a program prompts you
for various print options and printer paper sizes. If you click the
CANCEL option, you will correctly receive the following error on a
subsequent PRINT#n or WRITE#n statement:
"Bad File Name or Number" (Error 52)
This error occurs because you canceled opening the printer file. You
can trap the error with an ON ERROR GOTO statement and then resume
execution of the program.
This procedure applies to QuickBASIC Compiler Version 1.00, Microsoft
BASIC Compiler Version 1.00, and Microsoft BASIC Interpreter Versions
2.00, 2.10, and 3.00 for Apple Macintosh.
Modification Type: |
Minor |
Last Reviewed: |
1/8/2003 |
Keywords: |
KB42361 |
|