$WBUNTIL - loop until a condition becomes True

Important: If condition is not set properly $WBUNTIL function can get in infinite loop and stop the page processing until servers CGITimeOut is reached.

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

Syntax
$WBUNTIL{condition|content}
$WBUNTIL[condition|content]

Parameters
condition - an expression that can be True or false when evaluated
content - block of code (including WhizBase elements) that will be repeated until condition becomes True

Returns
Code contained in content repeated until condition becomes True.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>Titles</title>
</head>
<body>
$wbsetv[randomnum|0]
$WBUNTIL[$wbgetv[randomnum]=30|
The random number is:$wbgetv[randomnum]<br>
$wbsetv[randomnum|$wbfn[rnd(50)]]
]
Loop ended, random number value is $wbgetv[randomnum]!
</body>
</html> 

After running this example, the resulting page in browser, may look like this:

The random number is:0
The random number is:37
The random number is:33
The random number is:22
The random number is:41
The random number is:32
The random number is:23
The random number is:37
The random number is:46
Loop ended, random number value is 30!

Refresh the page few times and watch the changes of the result.