The askt( ) function works
in
the
same
way
as
askn(
),
but the expected input
is
text
instead
of
a number When
you
use
Xecute Abacus
will
display
the
message
in
the
input line and
then
wait for
you
to
type
In
some text
You
should type
in
the name of
the month for your balance,
[A6]
"Openi
ng
ba
lance
[A7]
"Salary
[A8]
"Mi
sce
llaneous
income
IC6]
askn(a6+"
for
"+$d4)
The
prompt string
for
askn( )
is
constructed
from
the
text
of
other
cell
entries,
using both
relative
and absolute
cell
reterences.
We
now
use
the
Echo command
to
copy
the
formula from
cell
C6
into
cells
C7
and
C8.
Instead
of
typing
the
range reference
C7:C8,
we
can
use
the
range Identifier col.
Echo,ceLL
c6,over
range
coL
(rows
7
to
8)
[810] "CREDIT
[C10]
sum(col)
[rows
6
to
81
Cell
C10
IS
used
to
contain
the
total
of
all
credits
for
the
month.
This
cell
is
labelled;
ItS
reterence
IS
'creditmonth':
The
cell's contents
are
calculated
uSing
the
sum( ) function which
we
met
in
the
tirst
example
in
this chapter
This
function adds
the
numeric contents
of
all
cells
in
the range
specitied by
its
argument Remember
that
it
Ignores
any
cell
,n
the
range that
is
empty
or that contains text
In
this
case
we
have
again
used
it
as
sum(col),
which
specoies
that
the
cels
to
be
summed
lie
in
the
current column.
As
normal, Abacus
asks
you
to
speCify
the
exact
range,
suggesting reasonable values based
on
your previous work.
IC11]
rept("=",len(str<credit.month,O,2)))
Cell
C11
underlines
the
total,
using the usual rept( ) and len( ) tunctlons.
In
this
case,
however
we
do
not
know
in
advance
the
number
of
characters
to
underline.
We
therefore
have
to
convert the number
to
a string
of
characters
with
the
str( ) function, assuming
that
it
is
to
be shown
in
decimal format
with
two
decimal places,
The
length
of
this string
gives the correct number
of
characters
to
underline,
[A13]
"Standing
orders
[A14j
"Charges
[013]
askn(a13+"
for
"+$d4)
[014]
askn(a14+"
for
"+$d4)
These
allow
you
to
enter the monthly debits
In
response
to
prompts,
uSing
askn( )
in
the
same way
as
described earlier
[A16]
"Cheques
[816]
"Date
[C16]
"Cheque no
[016J
"Amount
[817]
row="---"
[columns 8
to
OJ
These cells
set
up
an
area
of
the
grid which
you
Will
later
use
to
enter the details
of
your cheques,
[828] "DEBIT
[028]
sum
(co
l)
[rows
13
to
261
ThiS
calculates
the
total
of the debits, Remember that sum( ) only adds numeric values
in
the
cells
of
the
specified
range.
Cells
containing text and empty
cells,
are
not
Included.
The
sum
will
therefore ignore
all
unused entries
in
the
list
of
cheques,
as
well
as
the
table heading
In
column 0
[A30]
"Closing
balance
[C3~
credlt.month-debit.amount
The
calculation
of
the closing balance completes the grid entries,
You
should now
use
the
commands
to
tidy up
the
appearance
of
the application,
First
we
can use
the
Echo command
to
fill
the
rest
of
the
cheque table and complete
the
underlining
of
the
totals.
ThiS
command makes copies
of
the
contents
of
a single
12,'84
Exampjes
23