On.. Gosub; On.. Goto - Omron TJ1-MC04 - PROGRAMMING 1 Programming Manual

Hide thumbs Also See for TJ1-MC04 - PROGRAMMING 1:
Table of Contents

Advertisement

BASIC commands
3.2.194 ON
/i
Type
Constant (read-only)
Syntax
ON
Description
The ON constant returns the numerical value 1.
Arguments
N/A
Example
OP (lever,ON)
The above line sets the output named lever to ON.
See also
N/A

3.2.195 ON.. GOSUB

/i
Type
Program control command
Syntax
ON expression GOSUB label { , label }
Description
The ON..GOSUB and ON..GOTO structures enable a conditional jump. The
integer expression is used to select a label from the list. If the expression has
value 1 the first label is used, for value 2 then the second label is used, and
so on. Once the label is selected, subroutine GOSUB jump to that label is
performed.
Note: If the expression is not valid, no jump is performed.
Arguments
expression
Any valid BASIC expression.
label
Any valid label in the program.
Example
REPEAT
GET#5,char
UNTIL 1<=char and char<=3
ON char GOSUB mover, stopper, change
See also
GOSUB..RETURN, GOTO.
PROGRAMMING MANUAL

3.2.196 ON.. GOTO

/i
Type
Program control command
Syntax
ON expression GOTO label[,label[,...]]
Description
The expression is evaluated and then the integer part is used to select a label
from the list. If the expression has the value 1 then the first label is used, 2
then the second label is used, and so on. If the value of the expression is less
than 1 or greater than the number of labels then an error occurs. Once the
label is selected, subroutine GOTO jump to that label is performed.
Arguments
expression
Any valid BASIC expression.
label
Any valid label in the program.
Example
REPEAT
GET #1,char
UNTIL 1<=char and char<=3
ON char GOTO mover,stopper,change
See also
N/A
3.2.197 OP
/i
Type
I/O command
Syntax
OP(output_number, value)
OP(binary_pattern)
OP
119

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tj1-mc16 - programming 1Tj1-mc04 1

Table of Contents