Ah, never mind, I think I found that once it executes one section it jumps to the endif.
I am not sure what happens when doing math in an if...elseif....endif routine.
Let's say a variable w1 is tested and meets the > 1004 test. If, in the math that is then executed, w1 now meets the test of range 2, 3, or 4, will that choice also be executed, or once it has met one test does it jump to the end of the routine?
I would like to use the same word variable throughout this test due to space constraints. If I have to, I can change the math line to a different variable to house the result so that w1 does not change during execution of this routine.
I am not sure what happens when doing math in an if...elseif....endif routine.
Let's say a variable w1 is tested and meets the > 1004 test. If, in the math that is then executed, w1 now meets the test of range 2, 3, or 4, will that choice also be executed, or once it has met one test does it jump to the end of the routine?
I would like to use the same word variable throughout this test due to space constraints. If I have to, I can change the math line to a different variable to house the result so that w1 does not change during execution of this routine.
Code:
'Range1
if w1 > 1004 then
w1 = w1 * 12 / 17 - 45
'Range2
elseif w1 > 725 and w1 < 1005 then
w1 = w1 * 5 / 47 + w1 - 447
'Range3
elseif w1 > 474 and w1 < 726 then
w1 = w1 * 25 / 41 - 86
'Range4
elseif w1 < 475 then
w1 = w1 * 26 / 67 + 19
endif
endif
Last edited: