See the routine ShowDefinedVars in TEMPLATE.CMD for a routine which lists all defined variables in the scope of a routine (using Dave Boll's excellent DLL RXU).