Denso RC5 Spezifikationen Seite 267

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 692
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 266
Chapter 11 Flow Control Statements
11-17
11.4 Conditional Branch
IF-END IF (Statement)
Function
Conditionally decides a conditional expression between IF-END IF.
Format
IF <Conditional expression> THEN
:
[ELSEIF <Conditional expression> THEN]
:
[ELSE]
:
END IF
Explanation
The execution of a program is controlled with the condition of <Conditional
expression>.
If <Conditional expression> of an IF statement is true (except for 0), then the
statements between the IF-ELSEIF statement are executed. If the
<Conditional expression> is false (0), then <Conditional expression> of an
ELSEIF statement is decided. In the same manner as this, ELSEIF-ELSE and
ELSE-END IF are executed.
Related Terms
IF-THEN-ELSE
Example
DIM li1 As Integer
IF li1 = 0 THEN 'When li1 is 0.
STOP 'Stops the execution of the program.
ELSEIF li1 = 1 THEN 'When li1 is 1.
GOTO *samp1 'Jumps to the label of *samp1.
GO TO *samp2 'Jumps to the label of *samp2.
ELSEIF li1 = 2 THEN 'When li1 is 2.
GOSUB *samp3 'Calls the subroutine of the label name*samp3.
ELSE 'When li1 is another value.
RETURN 'Returns to the calling program.
END IF 'Declares the end to the IF statement.
Seitenansicht 266
1 2 ... 262 263 264 265 266 267 268 269 270 271 272 ... 691 692

Kommentare zu diesen Handbüchern

Keine Kommentare