Since each line has 40 print columns, the number of asterisks to be printed on each
side
of
the day
is
(40 - L)/2.
For example,
if
the current day is Friday, 17 asterisks must be printed before and after
the word Friday.
In line 44, the function STRING$ is used to construct a string of asterisks
of
the
correct length and assign it to the variable A$. Again,
if
L has the value 6, then
(40 -
L)12
=
17
and STRING$( (40 - L)/2,
"*")
will be a string of
17
asterisks.
If
the current day
is
Tuesday, then L = 7 and
(40 - L)/2
= 16.5
This value will be truncated to
16
in the STRING$ function so that
A$
will have
length 16.
The
gener~
form
of
the STRING$ function
is
STRING$(r,
"x")
which constructs a string consisting of r repetitions of the character x.
The argument r can be a numeric constant, variable or expression. For example, if
J=3
and
M=2
Command
PRINT STRING$(5,
"#")
PRINT STRING$(J,
"X")
PRINT STRING$(J-M,"&")
Displays
as
#####
XXX
&
Line 46 illustrates the concatenation operator +. The strings A$,
D$
and
A$
are
joined together to form a new string which is then assigned
to
the variable
0$.
The
concatenation operator can
be
used with string constants or string variables. For
example:
A$
=
"RADIO"
+
"SHACK"
concatenates the two strings
"RADIO"
and
"SHACK"
together to form a new string
"RADIO SHACK"
and assigns
it
to
the string variable A$.
Note that
in
line 46,
0$
appears both on the left and the right side of the equal sign.
Thus the old value which was assigned to
0$
is
replaced by the new string, which
is
printed in line 48.
61