CTCL

Do Statement

do i = 1 to 4                   -- red bars march down
  turn row i red off blue green -- in time to music
  call tdelay(0)                -- turning off blue and green
enddo                           -- as they go
The do statement is like unto the FORTRAN "DO" and the BASIC "for". The syntax is the word do followed by a variable, an "=" sign and an integer (constant or variable); then the word to and another integer. Optionally, the word step may follow, then another integer:
do j = 1 to n step 3
(The most difficult part of this for C programmers is remembering that the word is do.)

The loop is enclosed by the words do and enddo.

The power of this statment is rather limited; however, it has proved quite adequate in practice.

If the rows are numbered top to bottom, for example, and we want to march bars up the tree, we may do something like this:
do i = 4 to 1 step -1
  turn row i red
  call tdelay(0)
enddo
(This code fills the tree from bottom to top with red.)

Some programmers in the past have needed a "repeat ... until" loop for some reason, usually having to do with timing. In its current incarnation, CTCL has very accurate timing capabilities (milliseconds), so this problem should not arise. (On the other hand, if it does, there are workarounds....)