11 - 363 11 - 363
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
RESUME
Instruction
RESUME
• Resumes the program execution after the error handling is completed by the ON ERROR
GOTO instruction.
RESUME [<position to resume the execution>]
Syntax
position to resume the
execution
• • • •
Specify the position where the program execution is
to be resumed after the error handling.
No specification
• • •
The execution is resumed
from the instruction that
caused the error.
Specification of
NEXT
• • •
The execution is resumed
from the instruction
immediately after the
instruction that caused the
error.
Specification of
a line number
• • •
The execution is resumed
from the specified line
number.
RESUME
• • • •
Ends the error handling and resumes the program
execution from the instruction that caused an error.
RESUME NEXT
• • • •
Ends the error handling and resumes the program
execution from the instruction immediately after the
instruction that caused an error.
Examples
RESUME 150
• • • •
Ends the error handling and resumes the program
execution from line 150.
Description
• The RESUME instruction ends the error handling specified by the ON ERROR GOTO
instruction and resumes the program execution.
• Use one of the types shown below, depending on where the program execution should be
resumed:
(1) RESUME
Resumes the program execution from the instruction that caused the error.
(2) RESUME NEXT
Resumes the program execution from the instruction immediately after the instruction
that caused the error.
(3) RESUME <line number>
Resumes the program execution from the line specified in <line number>.
Program Example
10 ON ERROR GOTO 100
20 A=0
30 PRINT 100/A
• • • • • • • • • • •
An error occurs because 100 is devided by 0.
40 PRINT "End"
50 END
100 REM Error handling
110 A=1
120 RESUME
50
NEXT
Specification of
a line number
The program is
executed from
the specified
line number.
Specification
of NEXT
The program is executed
from the instruction
immediately after
the instruction where
the error occurred.
No
specification
The program is
executed from
the instruction
where the error
occurred.