Is this a bug or is this the way it is supposes to work?
I've only posted the relevent section of code but I'm confident there is nothing else interfering. It is part of a small routine to increased and decrease a variable with switches for Up and Down.
buttondown is an input switch ( It works fine)
IntervalSeconds is declared as a Word variable (w9)
on first run (intervalseconds will be 0 it's not actively set to anything) if an input of down is received IntervalSeconds decreases and registers as 65535, this is what I would expect to happen without the "min" command at the end of the line. So the min command is not doing anything.
The min command works as expected if I first increase intervalseconds to 1 or above.
To my, sleep deprived at the moment, mind I would expect that if min see's a value of 0 it should increase it to 1 in this case.
Code:
[color=Blue]elseif [/color][color=Black]buttondown [/color][color=DarkCyan]= [/color][color=Navy]1 [/color][color=Blue]then
[/color][color=Black]IntervalSeconds [/color][color=DarkCyan]= [/color][color=Black]IntervalSeconds [/color][color=DarkCyan]- [/color][color=Navy]1 [/color][color=DarkCyan]min [/color][color=Navy]1[/color]
buttondown is an input switch ( It works fine)
IntervalSeconds is declared as a Word variable (w9)
on first run (intervalseconds will be 0 it's not actively set to anything) if an input of down is received IntervalSeconds decreases and registers as 65535, this is what I would expect to happen without the "min" command at the end of the line. So the min command is not doing anything.
The min command works as expected if I first increase intervalseconds to 1 or above.
To my, sleep deprived at the moment, mind I would expect that if min see's a value of 0 it should increase it to 1 in this case.