Group Abstract Group Abstract

Message Boards Message Boards

How to see package level variables ?

GROUPS:
Hello Everybody,

I just started to develop a Mma package inside Workbench and I have a question regarding the debugging process.
In my package I have several functions defined and I use variables that are local to the functions (defined inside Module[]) and
variables that reside at the package level. My problem is that when I debug a function I can only see the variables that I have defined
inside the Module[], but not those that exist at the package level. The question is now to to inspect the content of those package
level variables ??

For clarification here some sample code.
When I debug func I can see locVar, but not packVar !

BeginPackage["MyPackage`"]
func[x_]:=
Module[{locVar},
   locVar = x+5;
   packVar = x+2;
]
EndPackage[]

Many thanks,
   Alex
POSTED BY: Al Ex
Answer
6 months ago
It is possible to add a watch for packVar in the Expressions view, see here for more details.
POSTED BY: Ilian Gachevski
Answer
6 months ago
Hi Ilian,

That works and is definitely better than nothing.
However, only simple variables (bla=5) are correctly displayed.
More complicated structures, like a list of rules,  are not properly displayed  (they are strangely mangled), while local variables of the same type are correctly displayed in the "Variables" view :-(

Many thanks for the tip,
   Alex
POSTED BY: Al Ex
Answer
6 months ago