I know, this is a bit unfair, but there's a generic solution to that:
Using VAL with an integer(*1) will always be three bytes shorter than that integer used directly. No matter if needed in an expression, as parameter or as a GO TO/ GO SUB target :)
GOTO VAL "10" is 3 bytes shorter than
GOTO 10 :)
How it Works:
As described here
- a numeric constant uses 6 bytes plus its ASCII representation.
- VAL "" takes 3 bytes plus the ASCII string to be converted.
So there's always a net saving of 3 bytes.
The Fine Print
Of course doing an ASCII conversion every time a constant kills performance - essentially negating the otherwise great benefit of Sinclair BASIC regarding constants. Thus, in next to all real world cases, it is recommended to store it in a variable instead of doing that conversion every time. This not only speeds up execution, gaining back a bit of the lost speed, but saves another 2-3 bytes per usage (*2) after the second usage(*3).
*1 - Well, the same is of course true for float as well.
*2 - 2 bytes minimum with a single digit integer used and a two character variable. 3 bytes with a 1 character variable. and an additional byte for each additional digit of the number in question - all per usage.
*3 - Assigning a variable has an overhead of 5 bytes, so it need to be used at least twice to save over all.