Question

Nov 24, 2008 11:48

Open to the public as a general question. I'm completely stumped and can find no information online. It has to be some minutia that I don't know about. Or the compiler sucks.

//Global
static unsigned char myGlobalVar = 0;

bit myFunction()
{
static unsigned char myVar = 0;
static bit returnBit;

//if(myVar == 0)
//{
// returnBit = 1; //Works, makes sense.
//}

if(myVar == 0)
{
myVar = myGlobalVar;
returnBit = 1; //does not work, function returns 0
}
return returnBit;
}
Previous post
Up