ListAddString

InstallShield 2018 » InstallScript Language Reference

The ListAddString function adds a string to a string list before or after the current element.

Note • ListAddString works only with string 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

ListAddString ( listID, szString, nPlacementFlag );

Parameters

ListAddString Parameters

Parameter

Description

listID

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

szString

Specifies the string to add to the list.

nPlacementFlag

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

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

Return Values

ListAddString 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