Admin Production ni-theme
Current Publication

GetTableColumnFromLabel

LabWindows/CVI

GetTableColumnFromLabel

int GetTableColumnFromLabel (int panelHandle, int controlID, int beginningColumnIndex, int *columnIndex, char label[], int visibleLabelsOnly);

Purpose

Returns the index of the first column with a label matching the specified label.

The function searches the labels you set using the ATTR_LABEL_TEXT column attribute, not the string representations of the numerical indices of the columns, which are the column labels you see by default.

The function returns an index of –1 if the label is not found.

Supported Controls

You can use GetTableColumnFromLabel with table 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.
beginningColumnIndex int The one-based index of the first column you want the function to search.
label char [] The label you want to locate in the table columns.

You can pass an empty string if you want the function to return the index of the first column not containing a label.
visibleLabelsOnly int Specify a nonzero value or select Yes in the function panel to include in the search only columns with visible labels.

Specify 0 or select No in the function panel to include in the search columns for which labels are not visible.

For the labels to be visible, you must set the column attributes ATTR_USE_LABEL_TEXT and ATTR_LABEL_VISIBLE to TRUE. ATTR_USE_LABEL_TEXT is set to FALSE by default.
Output
Name Type Description
columnIndex int The one-based index of the first column with the specified label.

The function searches the labels you set using the ATTR_LABEL_TEXT column attribute, not the string representations of the numerical indices of the columns, which are the column labels you see by default.

The function returns an index of –1 if the value is not found.

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.5 and later