Cicode Programming Reference > Working with Conditional Executors > Using FOR ... DO Loops

Using FOR ... DO Loops

A For loop executes a statement or statements a specified number of times.

FOR Variable=Expression To Expression DO
Statement(s);
END

The following function uses a For loop:

STRING ArrayA[5]="This","is","a","String","Array";
INT
FUNCTION
DisplayArray()
INT Counter;
FOR Counter = 0 TO 4 DO
Prompt(ArrayA[Counter]);
Sleep(15);
END
END

This function displays the single message "This is a String Array" on the screen one word at a time pausing for 15 seconds between each word.

See Also

Working with Conditional Executors