I made a specific function that checks the integer newThumb. If it is the same as the current Thumb's state (stated in gthumb, a global variable) it returns nothing. If it is NOT the same, it goes through to see what it is and makes the appropriate changes, using other functions.
The thumb function works fine, it compiles with no errors:
CODE
parseThumb(integer newThumb)
{
if (newThumb == gThumb)
{
// Thumb is the same, do nothing.
}
else if (newThumb == 1)
{
cThumbOff(gThumb);
cThumbTuck("on");
gPrevThumb = gThumb;
gThumb = 1;
}
else if (newThumb == 2)
{
cThumbOff(gThumb);
cThumbDown("on");
gPrevThumb = gThumb;
gThumb = 2;
}
else if (newThumb == 3)
{
cThumbOff(gThumb);
cThumbRelaxed("on");
gPrevThumb = gThumb;
gThumb = 3;
}
else if (newThumb == 4)
{
cThumbOff(gThumb);
cThumbUp("on");
gPrevThumb = gThumb;
gThumb = 4;
}
}
But the function for the Index Finger does NOT work, which was basically cut and pasted directly from the Thumb function. It makes no sense. I get a syntax error (I will comment the location)
CODE
parseIndex(integer newIndex)
{
if (newIndex == gIndex);
{
// Index is the same, do nothing.
}
else if (newIndex == 1) // Syntax Error here, for no reason I can determine.
{
cIndexOff(gIndex);
cFistIndexFinger("on");
gPrevIndex = gIndex;
gIndex = 1;
}
else if (newIndex == 2)
{
cIndexOff(gIndex);
cRelaxedIndexFinger("on");
gPrevIndex = gIndex;
gIndex = 2;
}
else if (newIndex == 3)
{
cIndexOff(gIndex);
cSpreadIndexFinger("on");
gPrevIndex = gIndex;
gIndex = 3;
}
else if (newIndex == 4)
{
cIndexOff(gIndex);
cFlatIndexFinger("on");
gPrevIndex = gIndex;
gIndex = 4;
}
}
Can someone help me with this? I have stared at it for an hour and I can find no difference between these two functions.