FOR

From TVPaintWiki
Revision as of 12:56, 22 December 2009 by KenC (Talk | contribs) (Created page with '{{LangRefCatCrumbs}} FOR index = start to end [STEP step] (instructions) END Executes a series of instructions as long as index is less than or equal to end (given a…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<<<George<<<George Language Reference

  FOR index = start to end [STEP step]
     (instructions)
  END

Executes a series of instructions as long as index is less than or equal to end (given after TO). Index is initialized with a value equal to start. By default, index is incremented by 1 in each loop, and is compared with end. You can define the increment step using the STEP instruction. If STEP is negative, the loop will continue for as long as index remains greater than or equal to end.

Example :

// Count up to 10
FOR i = 1 TO 10
	PRINT i
END