Jump to content

Futurebasic/Language/Reference/def cycle

From Wikibooks, open books for an open world

DEF CYCLE Statement

[edit | edit source]

DEF CYCLE

[edit | edit source]

Statement

[edit | edit source]

✔ Appearance ✔ Standard ✔ Console

Syntax

[edit | edit source]

DEF CYCLE (min%, max%, var%)

Description

[edit | edit source]

Use this statement when you need to cycle the value of an integer variable through a series of consecutive values and then back to the minimum value. The DEF CYCLE statement is equivalent to the following lines:

INC(var%)

IF var% < min% OR var% > max% THEN var% = min%

min% and max% must be short integer values, and var% must be a short integer variable.