LOCATE (Funktion)

FreeBASIC-Referenz » Alphabetische Befehlsreferenz » L » LOCATE (Funktion)

Syntax: LOCATE
Typ: Funktion
Kategorie: Konsole

LOCATE gibt Informationen über die aktuelle Cursorposition und die Sichtbarkeit des Cursors zurück.

Der zurückgegebene Wert wird folgendermaßen berechnet:

(Spalte OR (Zeile SHL 8) OR (sichtbar SHL 16))

Das untere Byte ist also die Spalte, das obere Byte die Zeile, und im oberen Word wird das Sichtbarkeits-Flag angegeben.

Beispiel:

DIM AS INTEGER pst, row, lin, vis

pst = LOCATE
row = LOBYTE(pst)
lin = HIBYTE(pst)
vis = HIWORD(pst)

PRINT "Cursorposition:"
PRINT "Line: "; lin
PRINT "Row:  "; row
Print "visible: "; vis

PRINT

LOCATE 10, 2, 0

pst = LOCATE
row = LOBYTE(pst)
lin = HIBYTE(pst)
vis = HIWORD(pst)

PRINT "Cursorposition:"
PRINT "Line: "; lin
PRINT "Row:  "; row
Print "visible: "; vis

SLEEP

Unterschiede zu QB:
Der Einsatz von LOCATE als Funktion ist neu in FreeBASIC.

Siehe auch:
LOCATE (Anweisung), CSRLIN (Funktion), POS (Funktion), WIDTH (Funktion), Konsole