- IF BIT(&b001001001001001001001001001001001001001001001, bx + by + bz) THEN
Optimizations
This
Similar ORELSE: the second expression will only be checked if the first doesn't match.
You can speed up your code by puting time consuming computations (ie a function call) in the second expression.
- IF a = b ANDALSO c = d THEN
- IF a = b THEN IF c = d THEN
Similar ORELSE: the second expression will only be checked if the first doesn't match.
You can speed up your code by puting time consuming computations (ie a function call) in the second expression.
Someone earlier in the thread asked why andalso/orelse are slow.
When i added those operators, I based them on top of IIF. It's certainly possible to do it much better, but that was the only way I could find at the time that worked correctly, so I decided it was better to have the operators, working correctly, but not well optimized, than not have the operators at all.
When i added those operators, I based them on top of IIF. It's certainly possible to do it much better, but that was the only way I could find at the time that worked correctly, so I decided it was better to have the operators, working correctly, but not well optimized, than not have the operators at all.
Re:
Wanting an optimized program, I recently faced this problem and I still must code nested 'If'.yetifoot wrote:Someone earlier in the thread asked why andalso/orelse are slow.
When i added those operators, I based them on top of IIF. It's certainly possible to do it much better, but that was the only way I could find at the time that worked correctly, so I decided it was better to have the operators, working correctly, but not well optimized, than not have the operators at all.
Consequently, I filled a feature request: Execution speed optimization of 'Andalso' and 'Orelse'