ListWriteToFileEx

InstallShield 2014 » InstallScript Language Reference

The ListWriteToFileEx function writes or appends a string list to a text file. Each string appears on a separate line in the text file.

Syntax

ListWriteToFileEx ( listID, szFileName, nOptions );

Parameters

ListWriteToFileEx Parameters

Parameter

Description

listID

Specifies the name of a string list to write into a text file.

szFileName

Specifies the fully qualified name of the file to which the string list is to be written. If the file does not exist, it is created. If the file already exists and the LWTF_OPTION_APPEND_TO_FILE is not specified for nOptions, it is overwritten.

nOptions

Specifies the encoding of the file and whether the string list can be appended to it if it already exists. Choose one or more of the following predefined constants:

0—If the file already exists and the pre-existing file is Unicode, writes the file as Unicode. Otherwise, writes the file as ANSI.
LWTF_OPTION_WRITE_AS_UNICODE—Writes the file as Unicode.
LWTF_OPTION_WRITE_AS_ANSI—Writes the file as ANSI.
LWTF_OPTION_APPEND_TO_FILE—Appends the contents of the list to the existing file. If the file does not exist, the function creates the file (which is the same behavior as if this option was not specified).

You can combine two of these constants by using the bitwise OR operator (|). For example, combine the LWTF_OPTION_WRITE_AS_ANSI and LWTF_OPTION_APPEND_TO_FILE constants if you want the contents of the string list to be append to the file as ANSI.

Return Values

ListWriteToFileEx Return Values

Return Value

Description

ISERR_SUCCESS

Indicates that the function was successful.

< ISERR_SUCCESS

Indicates that the function was not successful.