EasyManua.ls Logo

Commodore Plus 4 - Page 69

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC
Version
3.S
Commands,
Functions,
and System
Variables
Parameters:
string
being
truncated,
number
of
characters
to
use
87
1.
The
master
string
can
be
any
text
string,
text-string
variable,
or
string
expression.
2.
The
LEFTS
result
always
begins
at
the
leftmost
character
in
the
master
string.
You
can
keep
as
many
characters
as
you
want.
If
the
length
specified
is
longer
than
the
master
string,
the
whole
string
is
returned.
Examples:
PRINT
LEFT$(
"GRADUAL"
,4)
GRAD
PRINT
LEFT$("RED",4)
The
string
contains
only
RED
three
characters,
so
only
three are
printed.
10
INPUT
"DO
YOU
WANT
TO
CONTINUE";
A$Checks
text
string
A$,
20
IF
LEFT$(A$,1)="Y"
THEN
GOSUB
70:
input
in
line
10,
for
the
ELSE
END
string
Y.
LEN
LEN
(string)
Abbr.
none
Counts
the
number
of
characters
in
a
text
string.
Parameter:
master
string
The
master
string
can
be
any
text
string,
text-string
variable,
or
string
expres
sion.
Blank
spaces
and
punctuation
count
as
characters.
Examples:
PRINT
LEN("HAYWIRE")
7
10
INPUT
"WHAT'S
YOUR
LAST
NAME";
L$
SO
IP
LEN(L$)
>
8
THEN
L$
=
LEFT(L$,8):
PRINT
"YOUR
NAME
HAS
BEEN
SHORTENED"
30
PRINT
L$
RUN
WHAT'S
YOUR
LAST
NAME
?
MACD0NALDS0N
YOUR
NAME
HAS
BEEN
SHORTENED
MACDONAL
Checks
the
length
of
L$
and
used
only
the
eight
leftmost
char
acters
if
the
length
is
over
eight.

Other manuals for Commodore Plus 4

Related product manuals