View previous topic :: View next topic |
Author |
Message |
jamesjl
Joined: 22 Sep 2003 Posts: 52 Location: UK
|
int1 variable declaration |
Posted: Wed Oct 25, 2006 5:38 am |
|
|
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
|
|
Posted: Wed Oct 25, 2006 5:52 am |
|
|
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.
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
|
|
Posted: Wed Oct 25, 2006 6:46 am |
|
|
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
|
|
Posted: Wed Oct 25, 2006 8:35 am |
|
|
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 |
|
|
|