StrPutTokens

InstallShield 2014 ยป InstallScript Language Reference

The StrPutTokens function extracts list items from the string list specified by listID and places them into the string specified by svString. The substrings placed into svString from listID are separated by szSeparator in the resulting string. Note that instances of szSeparator are not placed at the beginning and end of the string, only between list elements added to the string.

For example, if you call StrPutTokens with the list containing the items "One", "Two", "Three", "Four", and "Five" as the first parameter and ";" as the third parameter, svString will contain "One;Two;Three;Four;Five" after the function is called.

The value of bNull determines whether null characters are used to separate the substrings in the resulting string.

Syntax

StrPutTokens( listID, svString, szSeparator, bNull );

Parameters

StrPutTokens Parameters

Parameter

Description

listID

Specifies the string list to be processed. The string list identified by listID must already have been initialized by a call to ListCreate. Note that this function does not work with number lists.

svString

Specifies the resulting string.

szSeparator

Specifies a string to be used to separate each list item in the resulting string. Note that unlike the StrGetTokens function, passing a null string in this parameter will not result in a null separated string; it will result in the substrings being placed one after the other with no separators. Set bNULL to TRUE to create a null separated string.

bNull

If bNull is set to TRUE, null characters will be used to separate the substrings in the resulting string, and szSeparator will be ignored. Note that the resulting string will be double null terminated in this case. If bNull is set to FALSE, the substrings in the resulting string will be separated by szSeparator.

Return Values

StrPutTokens Return Values

Return Value

Description

0

Indicates that the function successfully created the string from the specified string list.

< 0

Indicates that the function was unable to create the specified string from the specified string list.