ascot diagnostics

A1765

Hint: A $ETRAP that only jumps to a label is what Set $ZTrap = "{label}" does; $ZTRAP is scoped to this frame, where $ETRAP is inherited by callees

A $ETRAP is set to a single Goto Label. IRIS compiles it and sends an error to Label, as $ZTRAP does, but the two differ in where the label runs. $ZTRAP unwinds to this frame, and the label’s Quit returns normally. $ETRAP runs the label in the frame where the error happened, and its Quit passes the error on unless the label clears $ECODE. Keep $ETRAP to cover the frames this one calls, or use $ZTRAP for this frame alone.

IRIS compiles the example.

ROUTINE Demo.ETrapGoto
Main
    Set $ETrap = "Goto Fail" //! A1765
    Set rate = ^Demo.ETrapGoto("rate")
    Write rate, !
    Quit
Fail
    Write "no rate: ", $ZError, !
    Quit

All diagnostics