User Tools

Site Tools


ugbasic:user:kw:locate
Translations of this page:


ugBASIC User Manual

LOCATE ✓

SYNTAX

   LOCATE [x],[y]

PURPOSE

The LOCATE command moves the text cursor to specific coordinates, and this new location sets the start position for all subsequent text printing until commanded otherwise.

All console positions are measured in “text coordinates”, which are measured in units of one printed character on console, with the x-coordinate controlling the horizontal position and the y-coordinate referring to the vertical.

The top left-hand corner of the console has coordinates of 0,0 whereas text coordinates of 15,10 refer to a position 15 characters from the left-hand edge of the console and 10 characters from the top.

The range of these coordinates will depend on the size of your character set and the dimensions of the display area allocated, known as a “console“.

All coordinate measurements are taken using text coordinates relative to the current console. If you try and print something outside of these console,the console will be automatically scrolled down.

The current console is automatically treated as a window, so there is no need to “open” one.

EXAMPLE

  LOCATE 15,0
  LOCATE ,20

See also the following example files:

ABBREVIATION

 Lc

AVAILABLE ON

SEE ALSO

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY