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.
LOCATE [x],[y]
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:
LOCATE ↔ Lc
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