Resume – Remote Processing CAMBASIC User Manual

Page 140

Advertising
background image

Comm ands - 107

RESUME

Statement

SYNTAX:

R E SU M E
RESUME NEXT
RESUME line

PURPOSE:

To continue program exe cution after an error rec overy procedure has been per formed.

REMARK S:

If NEXT is not declared, the main program will resume operation by re-executing the statement that
originally caused the error. Every err or– handling routine must eventually end either by executing a
R E S U M E st a te m e nt or b y t e rm i na t in g th e pr o g ra m .

If NEXT is specified, execution resumes at the statement immediately following the one which
caused the error.

When an error trap occurs, it has the effect of disabling the ON ERR G OTO statement that enabled
the trap. Any fur ther error occurring prior to the execution of another ON E RR GOT O statement
will cause the termination of the program. An ON E RR GOT O statement may be included at the
end of the error– handling routine to maintain the error trap enabled.

Error traps may be nested in the same manner as G OSUBs and function calls, and the error routine
may begin with an ON ERR GOTO statement, with its own error– handling routine. Each
erro r– handling r outine mu st be term inated with a R ESU ME statement.

NOTE: You cannot use program labels with RESUME.

Make sure you r e-declare error handling using ON ERR. When the error routine is executed, the
previous ON E RR is disabled.

Consider using EXIT CLE AR in an error handling routine. This will clear loop stacks and
s u br o u ti ne s . Y ou c an th e n s ta r t a t t he b eg in n in g of y ou r p ro g r am .

RELATED:

ON ERR

ERROR:

< RESUM E w/ o ON/ ERR> – if no corresponding error condition
< Can’t compile> – if line does not exist

Advertising