Microsoft KB Archive/76560

= LOCATE and PRINT with Semicolon on Line 25 to Avoid Scrolling =

Article ID: 76560

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBASIC 4.0b, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.5 for MS-DOS, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q76560



SUMMARY
On most PC systems, sending output to the last line of a text mode screen will cause the display to scroll. For example, if you are in 25-line mode, output on line 25 ending in a carriage return plus linefeed will cause the screen to scroll up one line.

To send output to the last line of a text screen in a Basic program, you can use the LOCATE statement to locate the cursor on the last line of the display, then PRINT the output, ending the PRINT statement with a semicolon to suppress the carriage return plus linefeed that Basic normally appends to each PRINT statement.

This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS and to Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2.



Example
CLS WIDTH 80, 25       'Sets display to 25-line mode. PRINT CHR$(201); PRINT STRING$(78, 205); PRINT CHR$(187); FOR count% = 2 TO 24 LOCATE count%, 1 PRINT CHR$(186); LOCATE count%, 80 PRINT CHR$(186); NEXT LOCATE 25, 1           'This puts you on line 25. PRINT CHR$(200);       'The semicolon prevents you from scrolling. PRINT STRING$(78, 205); PRINT CHR$(188); SLEEP END

Additional query words: QuickBas BasicCom 4.00 4.00b 4.50 7.00 7.10

Keywords: KB76560

-

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

© Microsoft Corporation. All rights reserved.