R Rauwomos New Member Oct 5, 2013 #1 Hi I'm just wondering if I use the dec command on a variable which is already 0, will it screw up my program Code: let b1 = 0 if pinb.2 = 1 then dec b1 endif if b1 = 0 then goto main Thanks
Hi I'm just wondering if I use the dec command on a variable which is already 0, will it screw up my program Code: let b1 = 0 if pinb.2 = 1 then dec b1 endif if b1 = 0 then goto main Thanks
Buzby Senior Member Oct 5, 2013 #2 DEC will roll-under to either 255 ( for byte variables ) or 65535 ( for word variables ) It's hard to tell what it will do to your program, we can't see it from here ! Try it in the simulator. Cheers, Buzby
DEC will roll-under to either 255 ( for byte variables ) or 65535 ( for word variables ) It's hard to tell what it will do to your program, we can't see it from here ! Try it in the simulator. Cheers, Buzby
S SAborn Senior Member Oct 5, 2013 #3 The easy solution would be ........ if pinb.2 = 1 and b1 > 1 then dec b1 ......................................
The easy solution would be ........ if pinb.2 = 1 and b1 > 1 then dec b1 ......................................