Just a rant about the SBasic AND operator.
30 if (a<>0 AND b/a=5)
50 end if
Run it and what happens?
You get an "overflow" error at line 30.
You get this error because it is trying to evaluate the second condition
(b/a) and failing as a=0 and you can't divide by 0.
BUT WHY IS IT TRYING TO EVALUATE THE SECOND CONDITION IN THE FIRST PLACE?
The first condition (a<>0) is NOT met and so, in any other programming
language I use, the second condition isn't even tested, as the result
will be "false" anyway because of this.
Apparently though, Sbasic still also tests the second condition.
QL-Users Mailing List