Remote-processing CAMBASIC Instrukcja Użytkownika Strona 71

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 208
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 70
Commands - 38
DO/ENDDO
Statements
SYNTAX: DO value
.
.
.
ENDDO
PURPOSE: To execute a loop a number of times quickly.
REMARK S: value range is 1 to 65535. It can be a number or variable.
The DO /EN DDO statements cause a list of statements to be executed for a number of times. It is 3
times faster than using a FOR/N EXT loop.
You can NOT exit a DO/ENDDO with the EXIT statement A way to gracefully exit a DO/ENDDO
loop is to set DO = 1 then GOTO the line at ENDDO.
NOTE: Nesting of DO /EN DDO loops is NOT permitted. This construct' s speed is due to the use
of a single counter.
EXAMPLE: 10 A= - 45
20 DO 45
30 INC A:PRINT A
50 ENDDO
Nesting DO/ENDDO loops is NOT allowed. An example of what NOT to do is shown below.
DO 25
GOSUB ..routine
ENDDO
'
..routine
DO 50
A = AIN(0) + A
ENDDO
RETURN
A DO loop counter empty error is returned after the GOSUB routine.
ERROR: < ENDDO> if ENDDO encountered without corresponding DO.
< DO loop counter em pty> - When a DO loop is nested and the most recent one was completed.
Przeglądanie stron 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 207 208

Komentarze do niniejszej Instrukcji

Brak uwag