bas7advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
LOCATE Statement Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
LOCATE moves the cursor to the specified position on the screen.
 
LOCATE  [row%] [,[column%] [,[cursor%] [,start% [,stop%]]]]
    ■ The argument row% is the number of a row on the screen; row% is a
      numeric expression that returns an integer. If row% is not specified,
      the row location of the cursor does not change.
    ■ The column% is the number of a column on the screen; column% is a
      numeric expression that returns an integer. If column% is not specified,
      the column location of the cursor does not change.
    ■ The cursor% is a Boolean value indicating whether the cursor is
      visible or not. A value of 0 indicates cursor off; a value of 1
      indicates cursor on.
    ■ The start% is the starting scan line of the cursor on the screen.
      It must be a numeric expression that returns an integer between
      0 and 31, inclusive.
    ■ The stop% is the ending scan line of the cursor on the screen.
      It must be a numeric expression that returns an integer between
      0 and 31, inclusive.
 
Usage Notes
    ■ You can omit any argument from the statement except that if stop% is
      specified, start% also must be specified. When you omit row% or
      column%, LOCATE leaves the cursor at the row or column where it was
      moved by the most recently executed input or output statement (such
      as LOCATE, PRINT, or INPUT). When you omit other arguments, BASIC
      assumes the previous value for the argument.
    ■ The start and stop lines are the CRT scan lines that specify
      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).
    ■ 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.
    ■ For screen mode information, see SCREEN Statement.