I have some code that is puzzling me.
Dim iCycle as Long
Dim iStep as Integer
iStep = 10
more code ...
If iCycle >= 10 * 60 * 1000 / iStep then
'Do something
end if
I get a Error 6 overflow on the IF line of code.
If iCycle >= 10 * 60 * (1000 / iStep) then
I don't understand as 10*60*1000 = 600,000 which is well within the Long range.
Anyt thoughts would be welcome.
However it does not erro if the line of code is
Dim iCycle as Long
Dim iStep as Integer
iStep = 10
more code ...
If iCycle >= 10 * 60 * 1000 / iStep then
'Do something
end if
I get a Error 6 overflow on the IF line of code.
If iCycle >= 10 * 60 * (1000 / iStep) then
I don't understand as 10*60*1000 = 600,000 which is well within the Long range.
Anyt thoughts would be welcome.
However it does not erro if the line of code is