mgnslndh/NCicode — Issue #5: FOR ... DO Loops
Author: mgnslndh
Created: 2011-11-22 19:14:04+00:00
State: open

>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.