I have a quick question about which I did not find specific information on the web.
I want to perform a Do...Loop Until
loop, but I would like to insert more than one condition at the end. I would like to do:
Do
' ...my code...
Loop Until [Condition 1] And [Condition 2] And....And [Condition n]`
Is this possible?
Thank you very much in advance, Orlando
You can use
And
and/orOr
:And
will continue all the time all conditions are met.Or
will continue when one or more of the conditions are met.You can have any number of conditions.
The below example shows lazy evaluation implementation:
Such code allows to improve performance and speed up code execution. It evaluates conditions one by one until first false result only, if all conditions are true then it exits the loop, while conventional
And
operators evaluate all conditions regardless of the results.It is possible indeed as if you were using "if " statement, for example: