Posted: Thu Jan 10, 2019 6:15 pm Post subject: Strange results form variable calculations
Hello,
in my program I noticed some strange behaviour of some variables. All definitions are correct, no error messages etc. form compiler. The purpose of the program is to read an RC pulse and divide the measured range into 14 steps to control some lights.
wSwitchStep is 71, SwitchTolerance is 10, wPulseMinStore is 984
These definitions result in wLowLightWarn = 1552, wLowLightWarnLow = 1542, but wLowLightWarnHigh = 20 (!)
I'm using the same logic of variable assignment for the other switching states and there everything is o.k.
If I rename the variable like this, the calculation is correct.
Yes, that's it.
Believe me (or not); I spent some hours to find the cause, and wasn't able to see it in that bunch of code lines with similar definitions. It's the typical behaviour of seeing not the wood for the trees _________________ Best regards
Jürgen
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 You cannot attach files in this forum You cannot download files in this forum