guiListGetSelected (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function returns the index of the selected item in the list. When the selection is changed, the list selection changed event is sent.

 

Input:

list : SYSHANDLE

The handle to the list to find the selection in.

 

 

Returns: INT

>0

- The index of the selected item.

0

- No item selected.

-1

- Interface is not open (see guiOpen).

-3

- Invalid handle.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiListGetSelected : INT;
VAR_INPUT
  list : SYSHANDLE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  list   : SYSHANDLE;
  form   : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Get selected index".
  rc := guiListGetSelected(list := list);
  IF rc > 0 THEN
    DebugFmt(message:="Selected item: \1", v1:= rc);
  END_IF;
  ...
END;
END_PROGRAM;