Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Using FOR ​.​.​. DO Loops

  • Last UpdatedJul 18, 2023
  • 1 minute read

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

TitleResults for “How to create a CRG?”Also Available in