Microsoft KB Archive/60133

= Description of How LOCATE Can Change the Cursor Size =

Article ID: 60133

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 Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q60133



SUMMARY
The LOCATE statement provides the ability to change the cursor size in text mode (SCREEN 0). The number of scan lines varies depending on the video system and the operating system.

This information applies to Microsoft QuickBasic Versions 4.00, 4.00b and 4.50 for MS-DOS, Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and OS/2, and Microsoft Basic Professional Development System (PDS) Version 7.00 for MS-DOS and OS/2.



MORE INFORMATION
The following table shows the valid settings for most video systems:   Video System | Op Sys | Scan lines -++---  Hercules     |  DOS   |    12 CGA/EGA/VGA |  DOS   |     8 Any         |  OS/2  |    16 The cursor is a text mode feature and is not available for use with the LOCATE statement in graphics modes. INPUT is the only statement that automatically uses a cursor in graphics modes.

The following information, taken from the QBX.EXE online help from Basic PDS 7.00, is the description of the usage of the start and stop lines in the LOCATE statement:

The start and stop lines are the CRT scan lines that specify the following:
 * 1) Which pixels on the screen are lit.

A wider range between the start and stop lines produces a taller cursor, such as one that occupies an entire character block.

In OS/2 real mode and under DOS, LOCATE assumes there are eight lines (numbered 0 to 7) in the cursor. In OS/2 protected mode, there are 16 lines (numbered 0 to 15).
 * 1) When start% is greater than stop%, LOCATE produces a two-part cursor.

If the start line is given, but the stop line is omitted, stop% assumes the same value as start%.

A value of 8 for both start% and stop% produces the underline cursor.

The maximum cursor size is determined by the character block size of the screen mode in use.

Setting start% greater than stop% displays a full-height cursor on VGA-equipped systems.

Code Example
The following code example prompts you for start and stop scan lines and displays the cursor: SCREEN 0 CLS LOCATE 8, 10 DO INPUT &quot;Start line: &quot;,StartLine% IF StartLine% = -1 THEN END      'Enter -1 to end LOCATE 9, 10 INPUT &quot;Stop line: &quot;,StopLine% CLS LOCATE 10, 10, 1, StartLine%, StopLine% LOOP

Additional query words: QuickBas BasicCom

Keywords: KB60133

-

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

© Microsoft Corporation. All rights reserved.