Use ELSEIF.
The second test in each line is not needed, because the previous test already checked that condition. And having multiple conditions in an IF line involves temporary system variables to save the intermediate results.
The code in post#1 compiled to 559 words.
This one is 189 words.
PBP 2.60 required, but the same thing can be done without 2.60 and elseif.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



. Lets say for example that variable supply_in= 251. Does the program exits the IF..ENDIF block after it encounters the lines
.

Bookmarks