Original Author Paul Laughton, 2011
Page 69
De Re BASIC!
If you attempt to DECODE$() a string that is not a buffer string, you may get unexpected results. Besides
the function ENCODE$(), the commands Byte.read.buffer and BT.read.bytes can write buffer strings.
Your program can also build such strings directly, character-by-character.
If you read data from a file with Byte.read.buffer, you can use DECODE$() to reassemble the bytes into
BASIC! (UTF-16) strings. The charset specifies how the original string was encoded when it was written
as bytes to the file.
For example, a binary file may have embedded text strings for names or titles. In order to allow Unicode,
the text may be encoded. Let's say you read 32 bytes of binary data, consisting of 8 bytes of binary and
24 bytes of UTF-8-encoded text:
BYTE.READ.BUFFER file, 32, bfr$
namebfr$ = MID$(bfr$, 9)
name$ = DECODE$("UTF-8", namebfr$)
For encryption and URL- or Base64-decoding, see the three-parameter form of DECODE$(), above.
STR$(<nexp>)
Returns the string representation of <nexp>.
LOWER$(<sexp>)
Returns <sexp> in all lower case characters.
UPPER$(<sexp>)
Returns <nexp> in all upper case characters.
VERSION$()
Returns the version number of BASIC! as a string.
INT$(<nexp>)
Returns a string representing the integer part of the numeric expression.
HEX$(<nexp>)
Returns a string representing the hexadecimal representation of the numeric expression.
OCT$(<nexp>)
Returns a string representing the octal representation of the numeric expression.
BIN$(<nexp>)
Returns a string representing the binary representation of the numeric expression.