2021-10-30, 04:20 PM
(2014-09-16, 09:57 PM)einar Wrote:Code:IF (a < 30) THEN LET a = a + 2 ELSE LET a = a + 1 END IF
In Sinclair BASIC you can use AND and OR expressions for that.
In this case you'd need this:
LET a = ((a+2) AND (a < 30)) + ((a+1) AND (a >= 30))
Another example to truncate a float number:
LET n = -23.4
LET t = INT n + (1 AND SGN n = -1)
Unfortunately this doesn't work with Zx Basic

