CodeEditor.CursorPos Property

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

Use the CodeEditor.CursorPos property to get or set the position of the insertion point within the current Code Editor. The position means the index of the character to the right of the insertion point within the editor’s text.

Setting the CursorPos property value will move the insertion point to the specified position within the script that is currently opened in the Code Editor.

Declaration

CodeEditor.CursorPos

Read-Write Property Integer

Applies To

The property is applied to the following object:

Property Value

A zero-based integer number that specifies the insertion point position within the Code Editor’s text.

0 means that the insertion point is at the beginning of the script. The value equal to the length of the Code Editor’s text means that the insertion point is at the end of the script.

Remarks

If the Code Editor is not active in the TestComplete Workspace panel, the CursorPos property raises an error. To check if there is an active Code Editor, use the IsEditorActive property.

See Also

SelectionStart Property
SelectionEnd Property
Text Property
Working With the Code Editor

Highlight search results