In some languages the OR, in Capital the .OR. , operator does not evaluate the right hand argument/arguments if the left one returns TRUE.
Testing this on version 7.4 and 7.41 shows me that Capital Script does escape the .OR. evaluation the same way. I haven't tested .AND. yet however I assume, at this point, that it's similar.
Therefore the following code currently works as expected.
OpenTable("TableName") .OR. Echo("Table failed to open")
Although 'Return' does not actualy return a value to the script that calls it I am wondering if this is allowed by Capital Script in the case of the .OR. and .AND. operators, where it is the final part of the evaluation? If so I could effectively do the following.
OpenTable("TableName") .OR. (Echo("Table failed to open") .AND. Return FALSE)
I would like to use code constructs similar to the above to achieve more compact, and hopefully quicker, code. However, I would also like to be certain that in doing so it won't break on future releases.
I know that .OR.ing conditions where one of those conditions doesn't actualy return anything to evaluate would not be allowed in many languages. However, my reasoning in this regard is that if Captial Script does allow it and there are no unpleasent side effects from calling 'Return' as the last part of such an evaluation, then I will use such constructs.
Soon I will be rewriting quite a large script with the aim of improving it's performance and would be most grateful for an answer to the above.
Thank you also for your previous excellent help.