Mitsubishi Electric CR750-Q Instruction Manual page 293

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

On ... GoTo (On Go To)
[Function]
Branches to the step with the step label that corresponds to the designated value.
[Format]
On[]<Expression>[]GoTo[][<Branch Destination>] [, [<Branch Destination>]] ...
[Terminology]
<Expression>
<Call Destination> Describe the step label No. The maximum number is 32.
[Reference Program]
Branches based on the value (1-7) of the numerical variable M1.
(Branches to label L1 if M1 is 1, to label LJMP if M1 is 2, to label L2 if M1 is 3, 4 or 5, and to label L67 if M1
is 6 or 7.)
10 On M1 GoTo L1,*LJMP,*L2,*L2,*L2,*L67,*L67
11 ' Control is passed to this line when M1 is other than 1 through 7 (i.e., 0, or 8 or larger).
20 *L1
21 ' Describes processing when M1=1.
22 '
:
30 *LJMP
31 ' Describes processing when M1=2.
32 '
:
40 *L67
41 ' Describes processing when M1=6 or M1=7.
42 '
:
50 *L2
51 ' Describes processing when M1=3, M1=4, or M1=5.
52 '
:
[Explanation]
(1) This is the GoTo version of On GoSub.
(2) If the value of <expression> is larger than the number of <destinations called up>, the program control
jumps to the next step. For example, the program control jumps to the next step if the value of <expres-
sion> is 5 and there are only three <destinations called up>.
(3) When a step No. or label that is called up does not exist, or when there are two definitions, an error will
occur.
Value of <Expression>
Real number
When 0, or when the value exceeds the num-
ber of step labels
Negative number or 32767 is exceeded
Designate the step label on the line to branch to with a numeric operation expression.
' When M1=2.
Process <Control>
Value is converted to an integer by rounding it off,
and then branching is executed.
Control proceeds to the next step
Execution error
Detailed explanation of command words 4-273
4MELFA-BASIC V

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents