GetChar Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:25

Description

Returns the code of the character at the cursor position (left of insertion point).

Valid only if the type is text or inside a tag (markup or HTML).

Syntax

object.GetChar

object

Required. Object name, returned by objCursor created through Text.GetCursor.

Example

Dim objCur = Text.GetCursor(modeSrcOn,cposCursor,False)

Dim objdesc As TxtPosDesc = objCur.GetDesc

Value = objDesc.GetChar

Remarks

To return the character itself, use Chr(objdesc.GetChar).

Please note that character is not returned if the cursor is before open or close tag, end paragraph or end line and other control characters. If you use, for example, the code msgbox "Char: " & Chr(objdesc.getchar) &  " Length: " & Len(Chr(objdesc.getchar)), the part with Length is not displayed.

Note

The similar functionality is available in object returned by Text.GetTextStatus, Text.GetParaTextStatus and Text.GetDefaultTextStatus functions. See TextStatus Object.

See also

GetCharH, GetCharW.