$WBSPLIT - convert string to array

Important: $WBSPLIT function has effect on entire WBSP page and all it's sub elements (configuration section, included files, sub reports, etc.). All instances of $WBSPLIT function that use the same array name will set same array regardless of their location inside WBSP page.

$WBSPLIT is available for use with all WBSP commands.


data - the string value (text) to be split
arrayname - the name of the array where elements will be stored
separator - a string containing one or more characters to use in separating the string
showvar - optional parameter  - if set to true (T,ON,1) WhizBase will show the last index (length-1) of resulting array
sort - optional parameter - if it exists WhizBase will sort the resulting array ascending (sort=A) or descending (sort=D). Any other sort value will be ignored.

Number of elements in resulting array if showvar parameter is set to true, otherwise it returns nothing, just creates the array.



After running this example, the resulting page in browser should contain the list of all files in the directory where current WBSP file is located.