Connecting Tech Pros Worldwide Forums | Help | Site Map

Help:: Watch List&Global Class

Newbie
 
Join Date: Jan 2009
Posts: 3
#1: Jan 8 '09
Hello,

I have a namespace and a class inside this namespace like that,

namespace Var
{
public class myVar
{
public:
long num;
};
}

I want to use this class and the variable in every event. In order to do this, I am declaring the class at the beginning of my code like that,

...
using namespace System::Drawing;
using namespace Var;
Var::myVar deg;

Whenever I want to to use the variable of this class in an event, I can use it like that,

deg.num=5;

However, if I want to add deg.num to watch list, I cant see anything. It gives error like that,

deg.num error: 'deg.num' does not exist

Where is my mistake? If I declare my class inside of an event and want to see variable, everything is ok. I think problem is somewhere in declaration. Could you please help me?

Banfa's Avatar
AdministratorVoR
 
Join Date: Feb 2006
Location: South West UK
Posts: 6,200
#2: Jan 8 '09

re: Help:: Watch List&Global Class


You can only put global variables in the watch list and get to see them all the time.

Local variables only exist when the function they are declared in is running so if they are in the watch list they will only be displayed if you break in the function they are declared in.
Newbie
 
Join Date: Jan 2009
Posts: 3
#3: Jan 8 '09

re: Help:: Watch List&Global Class


Quote:

Originally Posted by Banfa View Post

You can only put global variables in the watch list and get to see them all the time.

Local variables only exist when the function they are declared in is running so if they are in the watch list they will only be displayed if you break in the function they are declared in.

I declared my class at the beginning of my code as global. How can I see my variable when I break in an event that I use the variable?
Reply