Make your own free website on Tripod.com
4.4.2 Pitfalls when Using Condition Traps
There are several pitfalls when using conditions:

    Remember that some information are saved across the
  functions. Both the current trapped condition and the settings of
  the traps.  Consequently, you can not set a trap in a procedure
  level from a lower level. (I.e. calling a subroutine to set a trap
  is will not work.)

    Remember that SIGL is set when trapped by method CALL.  This
  means that whenever a condition might be trapped by CALL, the SIGL
  will be set to a new value. Consequently, never trust the contents
  of the SIGL variable for more than one clause at a time. This is
  very frustrating, but at least it will not happen often. When it
  do happen, though, you will probably have a hard time debugging
  it.

    Also remember that if you use the PROCEDURE clause in a
  condition handler called by method CALL, remember to EXPOSE the
  special variables SIGL if you want to use it inside the condition
  handler. Else it will be shadowed by the PROCEDURE.



PREV NEXT