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 support@ccsinfo.com

int1 variable declaration

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



Joined: 22 Sep 2003
Posts: 52
Location: UK

View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger

int1 variable declaration
PostPosted: Wed Oct 25, 2006 5:38 am     Reply with quote

Guys,

PIC18F6680
PCWH 4.013

I have a number of glafs set as int1 type. However, they seem to be losing their values during the execution of my app. If I change the variable from int1 to int8 and change the values from True to 1 and False to 0 wherever the int1 variable is used all works just fine!!

Code:


int1 RemoteFlag;

RemoteFlag = TRUE;

if(RemoteFlag == TRUE)
{
   [i]... do something here [/i]
}


The code in the above if will never be executed; however if I change the code to:

Code:


int8 RemoteFlag;

RemoteFlag = 1;

if(RemoteFlag == 1)
{
   [i]... do something here [/i]
}


all seems ok. This is an over simplification of my app but this is all I am trying to do. The int1 is a global not a local in my main app.

Any body got any thoughts on this?

Many thanks,

Jason.[/i]
Ttelmah
Guest







PostPosted: Wed Oct 25, 2006 5:52 am     Reply with quote

First, try the same code usng 3.249. All the V4 compilers have some significant oddities, so let's rule this out...
I took a while trying to work out what a 'glaf' was, and then realised it was a sort of dyslexic flag!. I'll have to start using these for some of my 'backward' logic. Smile

Generally, if (for instance), you have something like:
Code:

int val;
char str[10];
int8 flag1;
int8 flag2;
.....

//or:
int val;
char str[10];
int1 flag1;
int1 flag2;
.....

If a problem exists such as a character overrunning the end of the string storage, then it'll affect all the int1 values (since up to eight will be stored in a single byte), but only the first of the int8 values. If the problem persists with 3.249, then I'd suggest you look very hard at what is being done to the variable stored immediately in front of the flags.

Best Wishes
jamesjl



Joined: 22 Sep 2003
Posts: 52
Location: UK

View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger

PostPosted: Wed Oct 25, 2006 6:46 am     Reply with quote

Thanks for the info and sorry for the glaf. I didn't properly read it back before submitting it.

When I get a moment I will re-install 3.249 and give it a try. Can they be installed in parallel on the same machine? I'll post when I have some more info.

Many thanks,

Jason.
Ttelmah
Guest







PostPosted: Wed Oct 25, 2006 8:35 am     Reply with quote

Yes. Just make sure you point the installer at a different location. I have at present about ten versions installed, covering the versions that I have found fixed various problems at various times. So far, I have yet to find a V4 release that actually has anything fully working 'beyond' 3.249...

Best Wishes
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