REBOL 3 Docs | Guide | Concepts | Functions | Datatypes | Errors |
TOC < Back Next > | Updated: 16-Aug-2010 Edit History |
Evaluates a block until it is TRUE.
Arguments:
block [block!]
See also:
The until function evaluates a block until the block returns true. It is different from while because it only requires a single block, which also serves as the condition. However, the block is always evaluated at least once.
The general form is:
while [cond] [body]
For example:
num: 0 until[ print num num: num + 1 num >= 2 ] 0 1 2
Another example:
str: "test" until [ print str tail? str: next str ] test est st t
The last value of the block is returned from the until function. Because this is also the termination condition, it will always be non-none non-false, but that can be useful at times.
TOC < Back Next > | REBOL.com - WIP Wiki | Feedback Admin |