$WBAADD - add element to array

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

Availability
$WBAADD is available for use with all WBSP commands.

Syntax
$WBAADD{arrayname|varvalue|showvar}
$WBAADD[arrayname|varvalue|showvar]

Parameters
arrayname - the name of the array to which new element will be added
varvalue - the value of the new element that will be added
showvar - optional parameter  - if set to true (T,ON,1) WhizBase will show the new length of resulting array


Returns
New number of elements in resulting array if showvar parameter is set to true, otherwise it returns nothing, just adds the element.

Example

<!--
[FormFields]
wb_command=R
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBAAdd</title>
</head>
<body>
$wbsetv[filecount|0]
$wbsplit[$wbdir[|||d]|dirlist|,|f]
$wbwhile[$wbgetv[filecount]<=$wbsplit[$wbdir[]|fillist|,|t]
|
$wbaadd[dirlist|$wbgetv[fillist($wbgetv[filecount])]|f]
$wbsetv[filecount|$wbcalc[$wbgetv[filecount]+1]]
]
$wbsetv[filecount|0]$wbwhile[$wbgetv[filecount]<=$wbalen[dirlist]
|
$wbgetv[dirlist($wbgetv[filecount])]<br>
$wbsetv[filecount|$wbcalc[$wbgetv[filecount]+1]]
]
</body>
</html> 

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