Argox PA-20 Basic Programming Manual Instrukcja Użytkownika Strona 22

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 143
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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.
Przeglądanie stron 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 142 143

Komentarze do niniejszej Instrukcji

Brak uwag