Locate

Sets the current cursor position

Syntax
	KeyPgDeclareDeclare KeyPgFunctionFunction Locate( row KeyPgAsAs KeyPgLongLong = 0, column KeyPgAsAs KeyPgLongLong = 0, state KeyPgAsAs 
	KeyPgLongLong = -1, start KeyPgAsAs KeyPgLongLong = 0, stop KeyPgAsAs KeyPgLongLong = 0 ) KeyPgAsAs KeyPgLongLong

Usage
	Locate [row], [column], [state]

	result = Locate( [row], [column], [state] )
	new_column = KeyPgLoByteLoByte( result )
	new_row = KeyPgHibyteHiByte( result )
	new_state = KeyPgHiword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 in console-mode only: 0 is off, 1 is on; text 
		cursor is never visible in graphics mode.
	start
		Ignored. Allowed for CompilerOptlang-lang qb dialect compatibility only.
	stop
		Ignored. Allowed for CompilerOptlang-lang qb dialect compatibility only.

Return Value
	Returns a 32 bit KeyPgLongLong containing the current cursor position and state. 
	The KeyPgLoByteLow Byte Of The Low Word contains the column, the 
	KeyPgHibyteHigh Byte Of The Low Word contains the row, and the KeyPgHiwordHigh Word contains 
	the cursor state.

	If any of the row, column or state parameters were just set by the call 
	to Locate, then the return value will reflect these new values, not the 
	previous ones. If any of the parameters were omitted in the call to 
	Locate, then the return value will reflect the current values, which are 
	the same as before the call to Locate.

	Locate will attempt to position the cursor at the specified row and 
	column. If the position is beyond the screen extents, cursor will not 
	reposition. And next KeyPgPrintPrint to the screen will continue at last valid 
	cursor position.  When printing to the last line of the screen, and the 
	KeyPgPrintPrint statement has a new line character, the screen will scroll and 
	reposition the cursor automatically to the last line, column 1.

Description
	Sets the text cursor in both graphics and console modes.

Example
	Locate 10
	Print "Current line:"; CsrLin

	'' Text cursor + mouse tracking
	Dim As Long 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.
	* QB will raise an error if row or column are beyond the screen 
	  extents.

See also
	* KeyPgCsrlinCsrLin
	* KeyPgPosPos
	* KeyPgPrintPrint
	* KeyPgPrint?

