10-30-2021, 03:20 PM
(09-16-2014, 08: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
