guiListSetItem (Function)

Top  Previous  Next

Architecture:

NX32L

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 := listform:=formx:=1y:=1w:=5h:=6size := 10type:=1);
   // Set item 1 to "Item 1".
   rc := guiListSetItem(list := listindex:=1text := "Item 1");
   ...
END;
END_PROGRAM;