guiListSetItem (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

Firmware version:

1.00.00


This function sets the value of an item in the list.

 

Input:

list : SYSHANDLE

The handle to the list to set the item in.

 

index : INT

The index of the item to set.

 

text : STRING

The text to show in the item.

 

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-3

- Invalid handle or index.

-8

- The text contains invalid characters.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiListSetItem : INT;
VAR_INPUT
  list  : SYSHANDLE;
  index : INT;
  text  : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc     : INT;
  list   : SYSHANDLE;
  form   : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Create a scrolling list with space for 10 items
  rc := guiListCreate(list := list, form:=form, x:=1, y:=1, w:=5, h:=6, size := 10, type:=1);
  // Set item 1 to "Item 1".
  rc := guiListSetItem(list := list, index:=1, text := "Item 1");
  ...
END;
END_PROGRAM;