CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Out Of Scope

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tony hughes



Joined: 02 May 2004
Posts: 3
Location: manchester england

View user's profile Send private message Send e-mail

Out Of Scope
PostPosted: Tue May 04, 2004 1:05 am     Reply with quote

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
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue May 04, 2004 1:36 am     Reply with quote

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.
tony hughes



Joined: 02 May 2004
Posts: 3
Location: manchester england

View user's profile Send private message Send e-mail

Out of scope
PostPosted: Tue May 04, 2004 2:28 am     Reply with quote

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
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue May 04, 2004 7:08 am     Reply with quote

INT defines a variable as integer. To make a variable global define it at the top of your code outside of all the functions.
tony hughes



Joined: 02 May 2004
Posts: 3
Location: manchester england

View user's profile Send private message Send e-mail

Not out of scope anymore
PostPosted: Tue May 04, 2004 7:18 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group