guiListAppendText (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.00.00


This function appends an item to the list. If the list is full, the first item will be removed and all the other items will change index, to make room for the new item.

This function is therefore best suited for use with a list of type 1, as the selected item will change index when used on a list of type 2.

 

Input:

list : SYSHANDLE

The handle to the list to set the item in.

 

text : STRING

The text to show in the item.

 

 

Returns: INT

0

- Success.

-1

- Interface is not open (see guiOpen).

-3

- Invalid handle.

-8

- The text contains invalid characters.

-11

- The GUI API is not supported.

 

Declaration:

FUNCTION guiListAppendText INT;
VAR_INPUT
   list SYSHANDLE;
   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");
   // Append "Item 2" to the list.
   rc := guiListAppendText(list := listtext := "Item 2");
   ...
END;
END_PROGRAM;