114
The VIC 20
User
Guide
String
Functions
String functions allow you to manipulate string
data
in a variety
of
ways. You may never need to use some
of
the arithmetic functions, but you
must make the effort to learn every string function. .
Here
is
a list
of
the string functions that can be used with VIC BASIC.
STR$ Converts a number to its equivalent string of text
characters.
V AL Converts a string of text characters to their
equivalent number (if such a conversion
is
possible).
CHR$ Converts an 8-bit binary code to its equivalent
ASCII character.
ASC Converts an ASCII character to its 8-bit binary
equivalent.
LEN Returns the number of characters contained in a
text string.
LEFT$ Extracts the left part of a text string. Function
arguments identify the string and its left part.
RIGHT$ Extracts the right part of a text string. Function
arguments identify the string and its right part.
MID$ Extracts the middle section of a text string.
Function arguments identify the string and the
required
mid
part.
String functions let you determine the length
of
a string, extract por-
tions
of
a string,
and
convert between numeric, ASCII, and string charac-
ters. These functions take one, two,
or
three arguments. Here are some
examples.
STRf(14)
LEN("ABC")
LEN(Af+Bf)
LEFTf(ST$,l)
System
Functions
In the interest
of
completeness, VIC BASIC system functions are listed
below. They perform operations which you are unlikely to need until you are
an
experienced programmer. The only system function you are likely to use
fairly soon
is
the time-of-day function.
If
you print many variations
of
a