Original Author Paul Laughton, 2011
Page 38
De Re BASIC!
A logical value (false = 0, true <> 0) is a kind of number.
You can use string functions to convert numbers to strings. STR$(), INT$(), HEX$() and a few others do
simple conversions. FORMAT$() and USING$() can do more complex formatting.
For the purposes of this documentation, numbers that appear in a BASIC! program are called Numeric
Constants.
Strings
Strings in BASIC! are written as any set of characters enclosed in quote (") characters. The quote
characters are not part of the string. For example, "This is a string" is a string of 16 characters.
To include the quote character in a string, you must escape it with a backslash: \". For example:
Print "His name is \"Jimbo\" Jim Giudice."
prints: His name is "Jimbo" Jim Giudice.
Newline characters may be inserted into a string with the escape sequence \n:
Print "Jim\nGiudice"
prints:
Jim
Giudice
"\n" can mean different things on different systems. In BASIC!, it is the same as an ASCII LF (line feed)
character.
You can use another escape sequence, \t, to put a TAB character into a string. To embed a backslash,
escape it with another backslash: \\. Other special characters can be inserted using the CHR$() function.
Strings with numerical characters can be converted to BASIC! numbers using the VAL(<sexp>) function.
For the purposes of this documentation, strings that appear within a BASIC! program are called String
Constants.
Variables
A BASIC! variable is a container for some numeric or string value.
Variable Names
Variable names must start with the characters "a" through "z", "#", "@", or "_". The remaining
characters in the variable name may also include the digits, "0" through "9".
A variable name may be as long as needed.