LPRINT Forced to Screen Using OPEN in FUNCTION Procedure (37310)
This article was previously published under Q37310
SUMMARY
You should avoid invoking a FUNCTION procedure that performs I/O in
I/O statements.
For example, if a FUNCTION procedure that opens a file is invoked in
an LPRINT statement, the printing occurs on the screen instead of the
printer in the example below. The simplest way to work around this
limitation is to assign the FUNCTION procedure value to a temporary
variable and then LPRINT the temporary variable. You can also
eliminate the problem by taking the OPEN statement out of the FUNCTION
procedure.
This behavior applies to Microsoft QuickBasic Versions 4.00, 4.00b,
and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and
6.00b for MS-DOS and MS OS/2, and to Microsoft Basic PDS Version 7.00
for MS-DOS and MS OS/2.
Modification Type: |
Minor |
Last Reviewed: |
1/9/2003 |
Keywords: |
KB37310 |
|