GetTerCursorPos
Retrieve the current cursor position.
boolean GetTerCursorPos(CurCol)
int CurCol; | The integer variable where the current column number is returned. Input: Set 0 to return the line/col pair of values. Set to -1 to return the current character position using the CurLine value. Output: When the CurCol input value is set to 0, after a successful return from this method, you can retrieve the the current-column value using: if (tej.GetTerCursorPos(CurCol) {
CurCol=tej.TerGetOutInt("Col");
} |
int CurLine; | After a successful return from this method, you can retrieve the the current-line value using: if (tej.GetTerCursorPos(CurCol) {
CurLine=TerGetOutInt("Line");
} |
Description: This function returns the current cursor position. The cursor position can be retrieved as the absolute position or in terms of the line number and column number.To get the absolute cursor position, set the CurCol variable to -1 before calling this function. The absolute position (base 0) is returned in the CurLine variable.
Example:int CurCol=-1;int CurLine;
| GetTerCursorPos(CurCol); | returns absolute position in the CurLine variable. if (tej.GetTerCursorPos(CurCol) {
CurLine=TerGetOutInt("Line");
} |
To get the line (base 0) and column (base 0) position of the cursor, set the CurCol variable to a value other than -1 before calling this function.
int CurCol=0;
int CurLine;
GetTerCursorPos(CurCol); | The current line number is returned in the CurLine variable, the current column is returned in the CurCol variable. if (tej.GetTerCursorPos(CurCol) {
CurLine=TerGetOutInt("Line");
CurCol=TerGetOutInt("Col");} |
Return Value: This function returns true when successful.