Sets the current cursor position
Syntax
Usage
Locate [row], [column], [state]
result = Locate( [row], [column], [state] )
new_column = LoByte( result )
new_row = HiByte( result )
new_state = HiWord( result )
Parameters
row
the 1-based vertical character position in the console.
column
the 1-based horizontal character position in the console.
state
the state of the cursor. 0 is off, 1 is on (console-mode only).
start
Ignored. Allowed for
-lang qb dialect compatibility only.
stop
Ignored. Allowed for
-lang qb dialect compatibility only.
Return Value
Description
Sets the text cursor in both graphics and console modes.
Example
Locate 10
Print "Current line:"; CsrLin
'' Text cursor + mouse tracking
Dim As Integer x = 0, y = 0, dx, dy
Cls
Locate , , 1
While Inkey <> Chr(27)
GetMouse dx, dy
If( dx <> x Or dy <> y ) Then
Locate y+1, x+1: Print " ";
x = dx
y = dy
Locate 1, 1: Print x, y, ""
Locate y+1, x+1: Print "X";
End If
Wend
Differences from QB
- The start and stop arguments have no effect in FreeBASIC.
See also