Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.
JBtje edited this page Jun 8, 2015 · 6 revisions

Syntax

FOR <variable> = <from> TO <to> [STEP <step>]

NEXT <variable>

Description

This code is rather self explaining. A variable will contain the value , up to . It is possible to set a step size using STEP. If you want a loop with descending values, the value must be negative e.g. "STEP -1".

Example

NEW
10 FOR A = 1 TO 10
20 PRINT A
30 NEXT A
40 FOR A = 10 TO 1 STEP -1
50 PRINT A
60 NEXT A
RUN

The above example outputs the numbers 1 to 10 and 10 to 1.

Clone this wiki locally