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 screen positions are measured in “text coordinates”, which are measured in units of one printed character on screen, with the x-coordinate controlling the horizontal position and the y-coordinate referring to the vertical.

The top left-hand corner of the screen has coordinates of 0,0 whereas text coordinates of 15,10 refer to a position 15 characters from the left-hand edge of the screen 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 “window”.

All coordinate measurements are taken using text coordinates relative to the current window. If you try and print something outside of these limits, an error will be generated or the screen will be automatically scrolled down.

The current screen 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

  • Atari (400/800)
  • Atari XL/XE
  • Commodore 128 (MOS 8502)
  • Commodore 128 (Zilog Z80)
  • Commodore 64
  • TRS-80 Color Computer
  • TRS-80 Color Computer 3
  • ColecoVision
  • Amstrad CPC 664
  • Dragon 32
  • Dragon 64
  • Thomson MO5
  • Thomson MO5
  • Olivetti Prodest PC128
  • Commodore PLUS/4
  • SEGA SC-3000
  • SEGA SG-1000
  • VG-5000
  • Commodore VIC-20
  • ZX Spectrum 48

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