Argox PA-20 Basic Programming Manual Manuel d'utilisateur Page 22

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 143
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 21
PT-Basic Programming Manual Ver. 1.00 21/143
3.3 Commands for looping structures
EXIT
Purpose
To provide an alternative exit for looping structures,such as
FOR…NEXT and WHILE…WEND statements.
Syntax
EXIT
Example
WHILE 1
IF INKEY$=CHR$(27) THEN „if press ESC key
then quit
EXIT
END IF
WEND
PRINT "EXIT..."
Description
EXIT can appear anywhere within the loop statement.
FOR NEXT
Purpose
To repeat the execution of a block of statements for a
specified number of times.
Syntax
FOR N% = startvalue TO endvalue [STEP step]
[Statement Block]
NEXT
Example
FOR N% = 1 TO 6 STEP 1
PRINT "FOR NEXT",N%
NEXT
Description
N% is an integer variable to be used as loop counter.
Startvalue is a mumeric expression which is the initial value
for the loop counter.
Endvalue is a numeric expression which is the final value for
the loop counter.
Step is a numeric expression to be used as an
increment/decrement of the loop counter. The step is 1 by
default.
If the loop counter ever reaches or beyond the endvalue,the
program execution continues to the statement following the
NEXT statement. The Statement block will be executed again
otherwise.
Vue de la page 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 142 143

Commentaires sur ces manuels

Pas de commentaire