Available on:
See also: AT$ CMOVE

LOCATE

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.

SYNTAX

 LOCATE [x],[y]


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 LOCATE 15,0
 LOCATE ,20


Used in:

ABBREVIATION: Lc

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

LOCATE ↔ Lc

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS