376
The
VIC
20
User
Guide
MID$
MID$ returns any specified portion of a string.
Format:
MID$(data$,byte,[,byte
2
])
Some number
of
characters from the middle
of
the string identified by
data$ are returned. The two numeric parameters byte, and byte
2
determine
the portion of the string which
is
returned. String characters are numbered
from the left, with the leftmost character having position
1.
The value of
byte, determines the first character to be extracted from the string. Begin-
ning with this character,
byte
2
determines the number
of
characters to be
extracted.
If
byte
2
is
absent then all characters up to the end
of
the string are
extracted.
An ILLEGAL QUANTITY
ERROR
message
is
printed if a parameter
is
out
of
range.
Example:
?MID$("ABCDE"
,2,1)
?MID$("ABCDE",
3,2)
?MID$("ABCDE",3)
PEEK
Prints B
Prints
CD
Prints
CDE
PEEK
returns the contents
of
the specified memory location. PEEK
is
the counterpart of the POKE statement.
Format:
PEEK(mem adr)
Example:
?PEEK(l)
A=PEEK(20000)
Prints contents
of
memory location I