FANDOM


(84) :Repeat Condition:Commands:End
(89) :Repeat Condition:Commands:EndRepeat

The Repeat command repeats a group of commands until [Condition] is true.

Unlike While [Condition] which tests the condition as soon as it is passed in the program, Repeat [Conditon] is tested when End is encountered.

Because of this, the instructions inside the Repeat loop are always run at least once.

Repeat can be nested.

If Repeat 0:commands:End is used, the repeat-end block will loop forever, since in boolean 0 equals false

Location Edit

  • PRGM
  • CTL
  • 6:Repeat

Example Edit

:Repeat X=5
:Disp "PLEASE ENTER 5
:Input "HERE:",X
:End
:Disp "YOU CHOSE 5

This program asks to PLEASE ENTER 5. Once 5 is entered, it will then display YOU CHOSE 5.

Note: Because Repeat tests X=5 once it hits the end there is no need to declare 0→X at the start.

See Also Edit

  • GetKey (examples with Repeat)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.