111 5 PRINT "Please input the time" 10 INPUT "Hours ",H 20 INPUT "Minutes ",M 30 TIME=H* 360000 + M* 6000 40 CLS 50 REPEAT 60 SEC=(TIME DIV 100) MOD 60 70 MIN=(TIME DIV 6000) MOD 60 80 HR=(TIME DIV 360000) MOD 24 90 PRINT TAB(7,12) HR;":";MIN;":";SEC;SPC(2) 100 UNTIL FALSE The clock is improved if you type VDU 23,1,0;0;0;0; which switches off the flashing cursor (see chapter 10). The next program would keep time to the end of the century – if you left the computer switched on that long!
10 lastminute=0 20 MODE7 30 PROCOFF 40 PROGgetdatetime 50 CLS 60 REPEAT 70 PROCshowtime 80 UNTIL FALSE 90 END 100 110 DEF PROCgetdatetime 120 CLS 130 PRINT"Please supply the day, month and year" 140 PRINT "as numbers e.g. 24 10 1984" 150 PRINT 160 170 REPEAT 180 PRINT TAB(5,10);"Day "; 190 INPUT TAB)12,10) ""day 200 UNTIL day>0 AND day 210 220 REPEAT 230 PRINT TAB(5,12);"Month "; 240 INPUT TAB(12,12)"" month 250 UNTIL month>0 AND month 260 270 REPEAT 280 PRINT TAB(5,14);"Year"; 290 INPUT TAB(12,14) "" year