Rockwell-automation 1771-DB Basic Module User Manual - Series A Manual de usuario Pagina 62

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 167
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 61
Operating Functions
Chapter 5
5–25
Unlike the RUN command the GOTO statement, if executed in the
COMMAND mode, does not clear the variable storage space or
interrupts. However, if the GOTO statement is executed in the
COMMAND mode after a line is edited the module clears the variable
storage space and all BASIC evoked interrupts. This is necessary
because the variable storage and the BASIC program reside in the same
RAM memory. Because of this editing a program can destroy variables.
Mode: RUN
Type: CONTROL
The value of the expression following the ON statement is the
number in the line list that control is transferred to.
Example:
u10 ON Q GOTO 100,200,300
If Q is equal to 0, control is transferred to line number 100. If Q is
equal to 1, control is transferred to line number 200. If Q is equal to 2,
GOTO line 300, etc. All comments that apply to GOTO and GOSUB
apply to the ON statement. If Q is less than ZERO a BAD
ARGUMENT ERROR is generated. If Q is greater than the line
number list following the GOTO or GOSUB statement, a BAD
SYNTAX ERROR is generated. The ON statement provides
“conditional branching” options within the constructs of a BASIC
Module program.
Mode: RUN
Type: CONTROL
The IF statement sets up a conditional test. The general form of the IF –
THEN – ELSE statement follows:
[ln num] IF [rel expr] THEN valid statement ELSE valid
statement
Example:
u10 IF A=100 THEN A=0 ELSE A=A+1
5.4.13
Statement: GOTO [ln num]
(continued)
5.4.14
Statements: ON [expr] GOTO
[ln num], [ln num],...[ln num],
ON [expr] GOSUB[ln num],
[ln num],...[ln num]
5.4.15
Statements: IF – THEN –
ELSE
Vista de pagina 61
1 2 ... 57 58 59 60 61 62 63 64 65 66 67 ... 166 167

Comentarios a estos manuales

Sin comentarios