LabWindows/CVI

Table of Contents
  • LabWindows/CVI Fundamentals
  • Creating Applications
  • Distributing Applications
  • Library Reference
  • Programmer Reference
  • Hardware Information

GetIndexFromValue

int GetIndexFromValue (int panelHandle, int controlID, int *index, ...);

Purpose

Returns the zero-based index of the first list item that has the value you specify. The function returns an index of –1 if the value is not found.

Supported Controls

You can use GetIndexFromValue with the following 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.
itemValue ... The value to search for among the list items.
Output
Name Type Description
index int Returns the zero-based index of the first list item that has the value you specify. Returns –1 if none of the list items have the specified value.

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 3.0 and later

Example

Refer to userint\graphlegend.cws for an example of using the GetIndexFromValue function.

Log in to get a better experience