Sharp MZ-700 Series Owner's Manual page 62

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

Note
2. 3. 8. 5 TIS
Format
Function
Example
The CLR command also cancels all f u n c t i o n definitions made with the D E F F N
statement; therefore, it is also necessary to reexecute D E F F N statements to rede-
fine such functions before they can be used again.
CLR statements cannot be included in a F O R ~ N E X T loop or BASIC subroutine.
TIS " hh mm ss"
TI$ is the name of the system string variable which contains t h e time of the com-
puter's built-in clock.
This built-in variable is automatically incremented once each second, and the six
character string contained in this variable indicates the hour, minute, and second,
with two characters used f o r each. F o r example, if the string contained in TIS is
1 1
092035", the time is 9 : 2 0 : 3 5 A. M.
Variable TIS is automatically set to 0 0 : 0 0 : 0 0 when BASIC is loaded into the com-
puter. T o set the current time of day, use the string assignment statement. F o r
example, the clock can be set to 7 : 0 0 : 0 0 P. M. by executing the following.
TIS = ." 190000"
T h e clock is set to 7 : 0 0 : 0 0 and t h e n restarted automatically when the CR key
is pressed.
The digits specified f o r the hour must be in the range f r o m 00 to 23, and those
specified f o r the m i n u t e and second must each be in the range f r o m 00 to 59.
The following program displays the current local time in various cities of the world.
1 0
P R I N T
" H "
2 0
D I M
C S C1 0 ) , D C1 0 ) , E C1 0 ) , T $
( 1 0 )
3 0
F O R
1 = 1
T O
1 0 : R E A D
C S CI ) , D C I )
: N E X T
I
4 0
P R I N T " E N T E R
N E W
Y O R K
T I M E
( H O U R , M I
N U T
E, S E C O N D )
"
5 0
I N P U T
B $ : T I $ = B $ : P R I N T " H "
6 0
P R I N T
" EP : T S C1 ) = T I S
7 0
F O R
1 = 1
T O
1 0
8 0
E ( I ) = V A L
C L E F T S C T S C1 ) , 2 ) ) + D C I )
9 0
I F
E CI ) = 2 4
T H E N
E CI )
= 0
1 0 0
I F
E CI ) < 0
T H E N
E CI ) = 2 4 + E
( I )
1 1 0
T S C I ) = S T R $
CE C I ) ) + R I G H T $ C T S C1 ) ,
4 )
1 2 0
I F
L E N C T S C I ) ) = 5
T H E N
T S C I ) = " 0 " + T S
C I )
1 3 0
P R I N T
C S C I )
; T A B C1 5 )
; L E F T S
C T S C I ) ,
2 )
;
1 4 0
P R I N T " : " ; M I D S C T S C I ) ,
3 , 2 )
; " : : " ; R I G H T S C
T S C I ) , 2 )
;
1 5 0
N E X T
1 6 0
D A T A
I R O ,
2
1 7 0
D A T A
C A I R O ,
7
1 8 0
D A T A
,
6
I : G O T O
6 0
N E W
Y O R K ,
0 , M O S C O W ,
8 ,
R I O
D E
U A N E
S Y D N E Y ,
1 5 , H O N O L U L U ,
- 5 ,
L O N D O N ,
5 ,
T O K Y O ,
1 4 ,
S A N
F R A N C I S C O ,
- 3 ,
P A R I S
60-

Advertisement

Table of Contents
loading

Table of Contents