Hi Scott,
Normally I wouldn't overload variable names like this but I'm working on a
sizeable legacy module (>4000 lines) and I'd rather keep any changes that I
make to the bare minimum (I'm wary of side-affects).
Your simple example works fine but there's a glitch when I try to do
something similar in my program. I can specify the global variable and local
variable with the same name (called "tc" in this case) in the watch window,
specifying "tc {graph.c, graph_dbg.exe}" for the global variable and "tc
{XPThresholds, graph.c, graph_dbg.exe}" for the local one and the Watch
Window seems to add them OK. However, both variables get updated
simultaneously with the same value whenever one instance or the other is
manually changed (e.g. via right-click->edit value).
Nick
"Scott Y" <x@no.email> wrote in message news:216901@exchange.ni.com...
> Hello,<br><br>I created a small example that demonstrates breaking program
execution and examining the contents of a global variable and a variable
with the same name that is only in scope during a function call.<br><br>Each
variable is displayed in a separate area of the watch window. The global
variable is labeled "foo {globTest_dbg.exe} and the variable whose scope is
limited to the testLocal function call is labeled "foo {testLocal,
globTest.c, globTest_dbg.exe}". The variables are displayed independently in
the watch window.<br><br>If you right click on the labels of either watch
expression and select "Edit Watch Expression..." you can see how the watch
points each of the two individual variables.<br><br>Scott Y.<br>NI
>
>
> GlobTest.zip:
> http://forums.ni.com/attachments/ni/180/16024/1/GlobTest.zip