ListCreate

InstallShield 2014 » InstallScript Language Reference

The ListCreate function creates an empty string or number list. You can create any number of lists in a script. A list may contain any number of elements. The only constraint is the amount of available free memory.

When calling any of the list functions, you must pass a valid ID of the list returned by this function. Verify this function was successful in creating the list. Otherwise, all the list functions will fail on the invalid list.

When you no longer need the list, you can destroy the list with the ListDestroy function.

Each list has a pointer that identifies an element as the “current” element of the list. The various list functions reposition the current element of the list.

Note: A list cannot contain both types of elements—numbers and strings. InstallScript provides separate functions to work with string lists and with number lists. You cannot use the ID of a number list with the string list functions and vice versa. Use list functions that end in “Item” for number lists and use list functions that end in “String” for string lists.

Syntax

ListCreate ( nListType );

Parameters

ListCreate Parameters

Parameter

Description

nListType

Specifies the type of list to create. Pass one of the following predefined constants in this parameter:

NUMBERLIST—Specifies a number list.
STRINGLIST—Specifies a string list.

Return Values

ListCreate Return Values

Return Value

Description

ListID

The ID of the newly created, empty list. You must use this ID whenever you want to use this list in other InstallScript list functions. You must check this variable and be sure the function did not return LIST_NULL.

LIST_NULL (-1)

Indicates that InstallShield is unable to create a list. This is a seldom seen condition that is the result of a serious memory problem. You might experience difficulties in continuing the setup with such memory problems.

Additional Information

Before you can pass a valid list ID to any function that requires a list, you must build the list using ListCreate.

See Also