Output Misdirected Using PRINT # and Function with OPEN (92724)
The information in this article applies to:
- Microsoft Visual Basic for MS-DOS
- Microsoft Basic Professional Development System for MS-DOS 7.0
- Microsoft Basic Professional Development System for MS-DOS 7.1
- Microsoft QuickBASIC 4.5
This article was previously published under Q92724 SYMPTOMS
Calling a function that performs an OPEN statement from within a
PRINT # statement incorrectly prints the information to the screen
instead of to the file. This problem also occurs with the WRITE #
statement.
STATUS
Microsoft has confirmed this to be a bug in the Standard and
Professional Editions of Microsoft Visual Basic for MS-DOS, version
1.0; Microsoft Basic Professional Development System for MS-DOS,
versions 7.0 and 7.1; and Microsoft QuickBasic for MS-DOS, version
4.5. We are researching this problem and will post new information
here as it becomes available.
One possible workaround to this problem, is to uncomment the two lines
in front of the PRINT # statement in the example below. These lines
assign the string returned by the function to a temporary variable and
then use the temporary variable in the PRINT statement. This avoids
calling the function directly from the PRINT # statement and the
program then acts as expected.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB92724 |
---|
|