REBOL 3 Docs | Guide | Concepts | Functions | Datatypes | Errors |
TOC < Back Next > | Updated: 10-Aug-2010 Edit History |
Evaluate a block over a range of values. (See also: REPEAT)
Arguments:
word [word!] - Variable to hold current value
start [series! number!] - Starting value
end [series! number!] - Ending value
bump [number!] - Amount to skip each time
body [block!] - Block to evaluate
See also:
loop repeat forall foreach forever forskip map-each remove-each
The first argument is used as a local variable to keep track of the current value. It is initially set to the START value and after each evaluation of the block the BUMP value is added to it until the END value is reached (inclusive).
for num 0 30 10 [ print num ]
30
for num 4 -37 -15 [ print num ]
-26
TOC < Back Next > | REBOL.com - WIP Wiki | Feedback Admin |