Here we have used the askn( ) function
to
request Input;
it
allows
you
to
choose which
table you
want.
by typing
in
a number.
A
I
B
I
C
I
0 E
F
1
MULTIPLICATION
TABLES
2
==================
3
The
7
times
tabLe
4 1
*
7 7
5
2 *
7
14
6
3 *
7
21
7
4 *
7
28
8
5 *
7
35
9
6 *
7
=
42
10
7 *
7
49
11
8 *
7
56
12
9 *
7
63
13
10
*
7
70
14
11
*
7
=
77
15
12
*
7
=
84
Figure 5.2 A
multiplication
table.
This
function takes a
text
string
as
Its
argument and displays the text
in
the input
line,
followed
by
a question mark.
It
then
walts
for
you
to
type
in
a number, ending
with
ENTER.
The
number that
you
type
In
will
be displayed
in
the cell which contains askn(
).
Note that askn( )
will
not wait
for
input during a normal auto-calculation of the grid.
It
will
only display the message and request input when
first
put the fomula into the cell,
or
when you force a recalculation of the grid by using the Xecute command. Once
you
have input a value
to
the
cell
it
will
be retained
until
the next lime you force a recalculation
with
the Xecute command.
The remaining grid entries use the column-filling facility
to
produce the body of the
multlplicalion table.
[84]
col=str(row()-3,2,Ol+"
*"
[rows 4
to
15)
This
is
the most complicated formula of the example.
It
is
used
to
display the multiplier
In
each
row
of the
table.
The number
IS
converted
to
a
text
string
so
that
we
can combine
it
with the multiplication sign and display them both
in
a single cell.
The
s1r(
) function converts a number
to
the
equivalent
stnng
of
digits.
It
takes
three
values;
the number
to
be converted, a code
for
the format
(0
~
deCimal, 1
~
exponential,
2
~
Integer,
3
~
general)
in
which the number
IS
to
be displayed, and the number
of deCimal places
to
be shown.
In
this case the number
is
converted
to
integer format.
In
this case the value
is
obtained from the expression 'row(
)-3',
whose value
is
1
,n
row
four,
2
In
row
five,
and so
on,
up
to
12
In
row
15.
The next value
(2)
selects display
as
an
Integer (whole number). The third number normally specifies how many decimal
places are
to
be used.
Its
value must
always
be given but
is
ignored for integers.
It
has
been given a value of zero (any other value could have been used).
Finally the result
is
concatenated (the correct
term
for adding one
text
string
to
another)
with
the string
*,
so that both the multiplier and the multiplication sign are displayed
in
a single cell.
[C4]
co
L=$c3 [rows 4
to
15]
Column C contains copies of the value typed
in in
answer
to
the askn( ) function. The
cell
reference
is
preceded by a $ sign
to
make
it
an absolute cell reference. When
you
have entered the formula, move the cursor up and down the cells of column C and
look
at
their
contents.
You
will
see
that
they
all
contain the
cell
reference
$C3.
The
reference
has not been adjusted
in
each row
An
absolute cell reference always
refers
to
one
particular cell, from any position
in
the grid.
You
can make any
cell
reference absolute
by adding a leading $ sign.
[041
co
L="=" [rows 4
to
15]
[E4]
coL=$c3*(row()-3)
[rows 4
to
151
These
last
two column entnes are almost self-explanatory. They are used
to
produce
the
equals sign and the answer for each
row
of the table. The
last
formula multiplies
Examples
21