CHR
Syntax
Description
Returns a string containing the ASCII characters whose codes are the given values. The arguments must be a numeric expression and, unlike Sinclair BASIC, parenthesis are mandatory. Returned value type is string.
Examples
This function is extended, and several values can be given at once. The result is a concatenation of all the given values:
The following lines are both equivalent, but the 2nd is faster and takes less memory:
In fact, if the compiler detects the programmer is using CHR(x) + CHR(y), it might compile it as
CHR(x, y) to perform such optimization.
Remarks
- This function is 100% Sinclair BASIC Compatible, but parenthesis are mandatory
- This function is expanded comparing to the original Sinclair BASIC
- As with other functions and variables, the trailing
$can be omitted.