Omron C200H-ASC11 Manual page 189

Ascii units
Hide thumbs Also See for C200H-ASC11:
Table of Contents

Advertisement

Details of BASIC Commands
on <expression>
Syntax:
<numerical expression> (
ON
|<label>)}
Description:
Statement. Branches to one of the specified subroutines depending on the value of a numerical
expression.
Remarks:
The value of the <numerical expression> determines which subroutine will be executed.
The <line number> specifies the starting position of the subroutine.
A <label> can be used instead of a line number after a
If the value of the expression is 1 then first branch will be taken, if 2 then the second branch will
be taken, and so on.
The valid range of the expression is : [1...255]. If the value of the expression is out of this valid
range then an "ILLEGAL FUNCTION CALL" error (code B005) will result.
If the value of the expression is 0 or if the value of the expression exceeds the number of branches
after the
statement is used for branching then the subroutine should be terminated with a
statement.
Examples:
> 10 FOR I = 1 TO 3
> 20 ON I GOSUB 100,200,300
> 30 NEXT I
> 40 END
> 100 PRINT "1"
> 110 RETURN
> 200 PRINT "2"
> 210 RETURN
> 300 PRINT "3"
> 310 RETURN
> RUN
1
2
3
See also:
180
GOTO
/
then execution will continue with the next statement. If the
GOTO
GOSUB
|
) (<line number> | <label>) {, (<line number>
GOSUB
GOSUB
Section
statement.
GOSUB
RETURN
7-6

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200h-asc21C200h-asc31

Table of Contents