Adding Elements to Lists

InstallShield 2020

InstallShield provides several functions for adding elements to lists:

Functions that Are Used to Add Elements to Lists

Function

Description

ListAddItem

Adds an item to the list.

ListAddString

Adds a string to the list.

ListReadFromFile

Reads a text file into a list.

ListAddString and ListAddItem add a single element to the list that you specify. Remember that, regardless of where you place the new string in the list, it becomes the current string. Use the options BEFORE and AFTER to indicate where you want to place the new element in the list relative to the current element. If you are working with a newly created list, using either BEFORE or AFTER will add the string to the first element position in the list.

Adding elements to a list and the resulting effects on the list order and the element in the current position are most easily explained by example. The examples below use string lists and ListAddString, but the same principles and steps apply to using ListAddItem and number lists. Consider these scenarios:

Adding an element to an empty list
Adding an element before the current element
Adding an element after the current element
Adding elements before and after the current element