•
and there are eight Internal pigeon holes Involved:
weekday$
EJ
length1
D
word$
~
length2
D
month$
IFEBRUARYI
length3
D
sum
G
average
D
Characters
and
Strings
•
If
you think that
IS
a
lot
of
fuss
for
a fairly simple problem you can certainly shorten
it.
The shortest
version
would be a single
line
but
It
would be
less
easy
to
read.
A reasonable
compromise uses the symbol
& which stands for the operation:
Join
two
strings
Now type:
NEW
10
LET
weekday$
;;;
"FIRST".II
20
LET
word$
;;;
"OF".IIL
30
LET
month$
=
"FEBRUARY"""
40
LET
phrase$
=
weekday$
&
word$
&
month$
..
"
50
LET
length
=
LEN(phrase$)."
60
PRINT
length/3."
RUN"II
The output
is
5
as
before but there are some different internal effects:
weekday$
FIRST
length
G
•
word$
OF
month
FEBRUARY
phrase$
FIRSmFFEBRUARY
There
is
one more reasonable simplification which
is
to
use READ and
DATA
Instead
of the first three LET statements.
Type:
NEW.II
10
READ
weekday$,
word$,
month$
..
"
20
LET
phrase$
=
weekday$
&
word$
&
month$."
30
LET
length
=
LEN(phrase$)."
40
PRINT
length/3."
50
DATA
"FIRST","OF","FEBRUARY""II
RUN"II
The internal effects of this version are exactly the same
as
those of the prevIous
one.
READ causes the setting up of internal pigeon holes wilh values
in
them
In
a similar
way
to
LET.
12/84
21