Use of $QUIT to handle Cache'-isms

From VistApedia
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