Re: A more program space efficient way of doing ta whole heap of IFs????

Originally Posted by
Darrel Taylor
Code:
if supply_in>= 253 then
max_duty = 154
ELSEIF supply_in> 250 then
max_duty = 155
ELSEIF supply_in> 248 then
max_duty = 156
ELSEIF supply_in> 245 then
max_duty = 157
ELSEIF supply_in> 240 then
max_duty = 159
ELSEIF supply_in> 237 then
max_duty = 160
ELSEIF supply_in> 234 then
max_duty = 161
ELSEIF supply_in> 231 then
max_duty = 163
ELSEIF supply_in> 229 then
max_duty = 165
ELSEIF supply_in> 226 then
max_duty = 167
ELSEIF supply_in> 223 then
max_duty = 169
ELSEIF supply_in> 220 then
max_duty = 172
ELSEIF supply_in> 218 then
max_duty = 175
ELSEIF supply_in> 215 then
max_duty = 179
ELSEIF supply_in> 212 then
max_duty = 181
ELSEIF supply_in> 210 then
max_duty = 182
ELSEIF supply_in> 207 then
max_duty = 184
ELSEIF supply_in> 204 then
max_duty = 188
ELSEIF supply_in> 201 then
max_duty = 191
ELSEIF supply_in> 199 then
max_duty = 195
ELSEIF supply_in> 196 then
max_duty = 214
ELSEIF supply_in> 193 then
max_duty = 238
ELSEIF supply_in> 187 then
max_duty = 251
ELSE
max_duty = 255
ENDIF
Darrel,
Let me ask a very dumb question here about your ELSEIF program
. Lets say for example that variable supply_in= 251. Does the program exits the IF..ENDIF block after it encounters the lines
ELSEIF supply_in> 250 then
max_duty = 155
or does it keep going through the rest of the ELSEIF lines in the IF..ENDIF block? I checked the manual but I didn't see the answer to my question.
Thanks,
Robert
"No one is completely worthless. They can always serve as a bad example."
Anonymous
Bookmarks