Microsoft KB Archive/94315

= Viewing File in QuickBasic Environment Can Change Spacing =

Article ID: 94315

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q94315



SUMMARY
If you load a file, other than Basic source code, into the Microsoft QuickBasic environment, the spacing in the file will be changed and additional characters may be added. Since the QuickBasic environment assumes you are loading a Basic source code file, it attempts to parse the contents of any file loaded into the environment. The parsing the environment does will almost certainly alter the spacing of any data files loaded into the environment.

To view the data file, use a text editor, or write a loop that reads in the data file and prints it to the default output window.



Steps to Reproduce Behavior
 Start QuickBasic.  Type in the following code: OPEN &quot;outfile&quot; FOR OUTPUT AS #1 FOR i = 1 TO 5 FOR j = 1 TO 5 PRINT #1, USING &quot;###   ###   &quot;;i;j; NEXT PRINT #1,    ' print space to next line NEXT CLOSE  Run the program.

If you now try to open the &quot;outfile&quot; file in the editor, it will look as follows:

1112131& 415

2122232& 425

3132333& 435

4142434& 445

5152535& 455

However, the actual output to the file would be as follows:   1   1   1   2   1   3   1   4   1   5 2  1   2   2   2   3   2   4   2   5   3   1   3   2   3   3   3   4   3   5   4   1   4   2   4   3   4   4   4   5   5   1   5   2   5   3   5   4   5   5 To view the data correctly, display it as follows: OPEN &quot;outfile&quot; FOR INPUT AS #1

WHILE NOT EOF(1) LINE INPUT #1, x$    PRINT  x$   WEND This will print the data to the screen as it appears in the file.

Additional query words: 1.00

Keywords: KB94315

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.