View previous topic :: View next topic |
Author |
Message |
tony hughes
Joined: 02 May 2004 Posts: 3 Location: manchester england
|
Out Of Scope |
Posted: Tue May 04, 2004 1:05 am |
|
|
I am using MPLAB ICD2 with CCS PCM a watch variable is giving out a "Out of scope message" I have changed the varibale type INT and it does not clear the problem, bet there is 1000's out there that know the answer,
Kind Regards,
PS very very new CCS user painfully converting from ASM.
Thanks in anticipation |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue May 04, 2004 1:36 am |
|
|
You are probably trying to watch a variable which is not in the current scope. For example you are watching variable A which is defined in the function func1(), but your code scope (the instructions that are being executed) is actually in some other function. If you need to know the value of the variable, either watch it in its own scope or define is as global.
What version of MPLAB are you using? If I remember correctly MPLAB 5.x doesn't let you watch the local variables. |
|
![](templates/subSilver/images/spacer.gif) |
tony hughes
Joined: 02 May 2004 Posts: 3 Location: manchester england
|
Out of scope |
Posted: Tue May 04, 2004 2:28 am |
|
|
Ali, thanks for the reply, I have tried all the INT there are and still I get "out of scope" MPLAB is the latest, what would you use for global ????
Tony up above you, what time is it there!
Reagrds |
|
![](templates/subSilver/images/spacer.gif) |
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue May 04, 2004 7:08 am |
|
|
INT defines a variable as integer. To make a variable global define it at the top of your code outside of all the functions. |
|
![](templates/subSilver/images/spacer.gif) |
tony hughes
Joined: 02 May 2004 Posts: 3 Location: manchester england
|
Not out of scope anymore |
Posted: Tue May 04, 2004 7:18 am |
|
|
Thanks Ali,
That works, I'm in a hell of a learning curve my last "C" was 7 years back
and at 0 I am finding it hard to get back in the saddle.
Thanks once again!
Tony |
|
![](templates/subSilver/images/spacer.gif) |
|