Tracing External routines

There are a couple of problems with the debug routines as developed:
  1. They cannot be used to trace external functions and subroutines
  2. You have to expose "debug." in every "Procedure" that contains debugging code, or a call to a routine which does.

The solution to this lies in using the "local environment object" (.local). If you are unfamiliar with this, then it can be seen as a way of creating variables which are available across all of the rexx routines that are running under the same invocation of rexx. This means all subroutines and functions called from your main program. If you execute external code by invoking a new copy of rexx then the .local object will not cross this boundary.

The following pages show the exact version of the debug routines that I'm currently using.