EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 180

Radio Shack TRS-80 Model III
274 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
TIME$
Returns today's
date and time. Your Model III
contains
a
built-in clock. To use this
clock, you
will want to first set it to the correct date
and time. To do this, you
may
type and
run this little program:
10 DEFINT
A-Z
20 DIM
TM(5)
30 CL
=
16924
40
PRINT "INPUT 6
VALUES: MO,
DA,
YR,
HR,
MN, SS"
50
INPUT
TM(0),
TM(1), TM(2), TM(3)» TM(4), TM(5)
60 FOR I
=
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 example, this
program line:
10 PRINTTIME$
causes
the Computer to print today's date
and time.
If
you do
not
set
the date and time, the Computer
will
keep time anyway. However,
the date and time will be set
at
zero when you first turn on the Computer or reset it.
NOTE: The clock
is turned off during cassette operations and
at
certain other
times. Therefore it will need to be corrected periodically.
VAL (string)
Performs the inverse
of the
STR$
function:
returns the number represented
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
(Seepage 104 in this section).
For example, if
A$
=
"12"
and
B$=
"34"
thenVAL(A$
+
"."
+ B$)
returns
the value 12.34. VAL(A$ +
"E"
+
B$) returns the
value l2E34,thatis
I2xl0
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
number is used in determining VAL;
the
non-numeric remainder
is ignored.
For example: VAL
("
100 DOLLARS") returns 100.
170

Other manuals for Radio Shack TRS-80 Model III

Related product manuals