Admin Production ni-theme
Current Publication

GetTextBoxLineIndexFromOffset

LabWindows/CVI

GetTextBoxLineIndexFromOffset

int GetTextBoxLineIndexFromOffset (int panelHandle, int controlID, int offset, int *lineNumber);

Purpose

For the specified text box control, returns the zero-based index of the line that contains the character at byteOffset bytes beyond the beginning of the text.

Supported Controls

You can use GetTextBoxLineIndexFromOffset with text box controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
offset int Number of bytes beyond the beginning of the text currently contained in the text box, including any embedded newline characters. Must be greater than or equal to zero.
Output
Name Type Description
lineNumber int Returns the zero-based index of the line containing the character that is byteOffset bytes beyond the beginning of the text. If byteOffset exceeds the number of bytes in the text, the function returns the number of lines in the text box.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 5.0 and later