guiListAppendText (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-400

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 := 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");
  // Append "Item 2" to the list.
  rc := guiListAppendText(list := list, text := "Item 2");
  ...
END;
END_PROGRAM;