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.

Parameters

Input
Name Type Description
panelHandle integer Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID integer 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 NewCtrl or DuplicateCtrl.
beginningColumnIndex integer 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 integer Set visibleLabelsOnly this to FALSE if you want the function to include in the search columns for which the 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 integer(passed by reference) 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 integer Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Code Error Message String
xx Success