LOCATE

Function

LOCATE sets the text cursor on the screen.

Syntax

LOCATE x,y

Maximum Value

Character Set

X

Y

Text mode

79

23

Char 0

239

63

Char 1

30

5

Char 2

30

5

Char 3

30

5

Char 4

30

5

Example

10 LOCATE 0,0

Places the cursor in the top left-hand corner.

Remarks

LOCATE is most useful for locating the cursor before printing text onto the display. LOCATE operates differently in text mode and graphics mode.

Text Mode:

Addressing a location outside the current window will cause the window to move so that the new cursor position is visible.

The maximum values for the parameters are X = 79 and Y = 23, being the size of the virtual screen.

Values greater than the maximum for X will cause wrap-around on the same line. Values greater than the maximum for Y will remain at the bottom of the screen.

Graphics Mode:

A SCREEN 1 command will reset the cursor to the origin at (0,0). When character set zero is selected the LOCATE co-ordinates are referenced to the graphics pixel position. Otherwise, the co-ordinates specified in LOCATE refer to the top left hand pixel of a 7 x 5 character cell, the size of which is equivalent to a CHAR1 character.