Use of $QUIT to handle Cache'-isms

From VistApedia
Revision as of 21:44, 12 July 2015 by Kdtop (talk | contribs) (Created page with "In Cache', a QUIT 1 (i.e. quit with an argument) work just fine if the call was with a DO rather than via SET Y=$$MyFun(). In GT.M, this will cause an error: >Quit does not ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In Cache', a QUIT 1 (i.e. quit with an argument) work just fine if the call was with a DO rather than via SET Y=$$MyFun().

In GT.M, this will cause an error:

>Quit does not return to an extrinsic function: > argument not allowed,150374450,-%GTM-E-NOTEXTRINSIC

Here is a solution that will work in either case:

QUIT:$QUIT <arg> QUIT

If code was called as an extrinsic, then $QUIT will equal 1