EasyManua.ls Logo

Radio Shack TRS-80 Model 3 - Page 180

Radio Shack TRS-80 Model 3
276 pages
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...
TRS-80 MODEL
III
TIME$
Returns
today's
date and time. Your Model III contains a built-in clock.
To
use this
clock, you will want to first setit to the correct date and time.
To
do this, you may
type and run this little program:
10 DEFINT
A-Z
20
DIM
TM(S)
30
CL
=
16924
40
PRINT "INPUT 6
VALUES:
MO,
DA,
YR,
HR,
MN,
55"
50
INPUT
TM(0),
TM(l),
TM(2), TM(3),
TM(4),
TM(5)
60
FOR
I = 0
TO
5
70
POKE
CL
-
I,
TM(I)
80
NEXT
I
90
PRINT
"CLOCK
IS
SET"
100
END
Once you have set the date and time with this program, you may request
it
any time
you want.
For
eXaIllple, this program line:
10
PRINT TIME$
causes the Computerto printtoday's date and time.
If
you do not setthe date andtime, the Computerwill keep time anyway. However,
the date and time will
be
set at zero when you first
tum
on the Computer
or
reset it.
NOTE:
The
clockis turned
off
during cassette operations and at certain other
times. Therefore it will needto becorrected periodically.
VAL (string)
Performs the inverse
of
the STR$ function: returns the numberrepresented by the
characters in a string argument.
The
numerical type
of
the result can be integer,
single precision,
or
double precision, as determined by the rules for the typing
of
constants (See page
1110
in this section). Forexample,
if
A$
=
"12"
and
B$
=
"34"
then VAL (A$ + "." + B$) returns the value 12.34. VAL(A$ +
"E"
+ B$) returns the
value 12E34, that is 12 x 10
34
.
VAL operates a little differently on mixed strings- strings whose values consist
of
a number followed
by
non-numeric characters. In such cases, only the leading
numberis usedin determining
VAL; the non-numeric remainderis ignored.
Forexample:
VAL (" 1
00
DOLLARS'
')
returns 100.
5/8

Related product manuals