i have a small chunk of code which i was wondering why it wasn't working. i
have the projects debugging level 1 up from "no optimizations". when i
place some frmCustomAlerts, a calculation is made, and some numbers are
assigned to ulongs. but when i remove the customAlerts, it totally skips
the calculation which is importent. so i tried putting the optimizations to
none and see what it does and now it does it. can anyone bring up anything
that might cause this bug? i say bug, because an optimizer isn't supposed
to skip lines of code.
Word CheckXORAdjustData(ULong serverDate, UShort offSet) {
ULong curDate;
ULong offSetSec;
ULong dateDiff;
curDate=TimGetSeconds(); // get units time in seconds
if(curDate==serverDate) { // if seconds match then exit
return 0;
}
offSetSec=offSet*60; // get offset in seconds
if(curDate>serverDate) {
// FrmCustomAlert(TestAlert, "TEST", " ", " "); // <---- these two
lines if removed make the entire if statement skipped
dateDiff=curDate-serverDate;
} else {
// FrmCustomAlert(TestAlert, "TEST2", " ", " "); // <---- these two
lines if removed make the entire if statement skipped
dateDiff=serverDate-curDate;
}
if(dateDiff>offSetSec) {
TimSetSeconds(serverDate);
return 2;
}
return 1;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/