LineLength

Description

Determines the length of the line containing the insertion point in an edit control.

Applies to

RichTextEdit, MultiLineEdit, and EditMask controls

Syntax

editname.LineLength ( )

Argument

Description

editname

The name of the RichTextEdit, MultiLineEdit, or EditMask in which you want to determine the length of the line containing the insertion point


Return value

Long.

Returns the length of the line containing the insertion point in editname. Returns -1 if an error occurs. If editname is null, LineLength returns null.

Usage

If the control contains a selection instead of a single insertion point, LineLength counts the line at the beginning of the selection.

PowerBuilder remembers where the insertion point is in each editable control. When the user moves the focus to another control, you can still find out the length of the line most recently edited by calling the LineLength function for that control.

Insertion point in editable controls

Because PowerBuilder remembers the position of the insertion point, users can resume editing at the insertion point if they make the control active by tabbing to it. When users make a control active by clicking on it, they move the insertion point as well.

For an EditMask control, LineLength reports the length of the mask, regardless of the number of characters the user has entered.

Examples

If the insertion point is positioned anywhere in line 5 of mle_Contact and line 5 contains the text Select All, il_linelength is set to 10 (the length of line 5):

integer li_linelength
li_linelength = mle_Contact.LineLength()

See also

Position

SelectedLine

SelectedStart

TextLine