Plug-in Reference — Inline Functions — Editor_LineFromChar

# Editor_LineFromChar

Retrieves the index of the line that contains the specified character index (the serial position). A character index is the zero-based index of the character from the beginning of the entire text. You can use this inline function or explicitly send the EE_LINE_FROM_CHAR message.

Editor_LineFromChar( HWND hwnd, int nLogical, UINT nSerialIndex );

## Parameters

hwnd

Specifies the window handle of the view or frame of EmEditor.

nLogical

Specify one of the following values.

Value | Meaning
--- | ---
POS_VIEW | Display Coordinates
POS_LOGICAL_A | Logical Coordinates (Count double-byte characters as two)
POS_LOGICAL_W | Logical Coordinates (Count double-byte characters as one)

nSerialIndex

Specifies the character index of the character contained in the line whose number is to be retrieved. If this parameter is -1, EE_LINE_FROM_CHAR retrieves the line number of the current line (the line containing the cursor).

## Return Values

The return value is the zero-based line number of the line containing the character index specified by nSerialIndex.