Description
Returns a Cursor object referring to a specific position inside the text
See also Cursor object.
Syntax
dim oCursor as Cursor = Text.GetCursor (nMode,nPos,bLimit) |
nMode
Mode of the returned cursor: -1=same as current editing mode, 0=WYSIWYG, 1=source mode with commands visible, 2=source mode with commands invisible
nPos
Position of the returned cursor: 0=text begin, 1=text end, 2=current cursor position, 3=begin selection, 4=end selection
bLimit
true to limit the cursor range to the part of the text on the current page, false to have no limits (valid only in Fred)
Return value
Error code
Context
Text designer commands
Example
Dim objFrom as Cursor = Text.GetCursor(modeSame,cposCursor,True) Dim objTo = objFrom.Duplicate objTo.Move (1) Text.EditCopyRange (objFrom,objTo) Text.DelRange (objFrom,objTo) objFrom.Move (1) Text.EditPasteTo (objFrom) |
Dim ocur = Text.GetCursor(1, 2, True) Dim objdesc As TxtPosDesc = ocur.GetDesc Dim chrType = objdesc.GetType If chrType = tptSoftHyphen Then 'soft hyphen ' just proceed ElseIf chrType = tptSoftLine Then Text.CursorRight() : lw = lw - 1 : Exit Do Else Exit Do End If |
For the meaning of the standard constants (eg. modeSame, cPosCursor) etc, see Ted constants related to Cursor and TxtPosDesc object.
See also
EditPasteTo Function, CursorTo Function, InsTedTextAt Function, EditCopyRange Function, DelRange Function.