ListAddItem

InstallShield 2014 » InstallScript Language Reference

The ListAddItem function adds a numeric element to a number list before or after the current element.

Note: ListAddItem works only with numbered lists.

To traverse a list:

1. Call ListGetFirstItem to get the first element in the list.
2. Call ListGetNextItem repeatedly until you reach the end of the list.

To make a specific element in the list the current element, call ListSetIndex.

Syntax

ListAddItem ( listID, nItem, nPlacementFlag );

Parameters

ListAddItem Parameters

Parameter

Description

listID

Specifies the name of a number list. The list identified by listID must already have been initialized by a call to ListCreate.

nItem

Specifies the numeric element to add to the list.

nPlacementFlag

Specifies where to put nItem relative to the current element. The new element will go either before or after the current element. Pass one of the following predefined constants in this parameter:

AFTER—Adds the new element after the current element in the list.
BEFORE—Adds the new element before the current element in the list.

Return Values

ListAddItem Return Values

Return Value

Description

> = ISERR_SUCCESS (0)

The function was successful.

< ISERR_SUCCESS (0)

The function was not successful.

ISERR_LIST_NOSUCHLIST (-501)

Indicates that a list with the specified ID does not exist. Valid list IDs are return values from the ListCreate function.

See Also