FOR Examples


Example 1:

 

  

FOR

COUNTER FROM "1" TO "8" USING "2"

  

DISPLAY

COUNTER

  

REPEAT

 

 

This loop displays the value of counter starting with a value of one and ending with a value of eight in increments of two.

 

Example 2:

 

  

FOR

COUNTER,"100","1","-1"

  

DISPLAY

COUNTER

  

REPEAT

 

 

This loop displays the value of counter in reverse order starting with a value of one hundred and ending with a value of one.

 

Example 3:

 

  

FOR

COUNTER FROM START TO END

  

...

 

  

REPEAT

 

 

This loop repeats starting with the value of the START variable and ending with the value of the END variable in increments of one.

 



PL/B Language Reference FLUSH Example FORK Examples