mirror of
https://github.com/mbirth/gwbasic.git
synced 2024-11-09 23:06:45 +00:00
97 lines
2.6 KiB
QBasic
97 lines
2.6 KiB
QBasic
|
10 CLS
|
|||
|
20 COLOR 15
|
|||
|
30 PRINT"UHR.BAS by RoboCop"
|
|||
|
40 PRINT
|
|||
|
50 PRINT"W<>hlen Sie eine Funktion:"
|
|||
|
60 PRINT
|
|||
|
70 PRINT"01 - Uhr"
|
|||
|
80 PRINT"02 - Wecker"
|
|||
|
90 PRINT"03 - Timer"
|
|||
|
100 PRINT"04 - int. Uhr stellen"
|
|||
|
110 PRINT"05 - int. Datum stellen"
|
|||
|
120 PRINT
|
|||
|
130 PRINT"Geben Sie die Kennziffer ein --->"
|
|||
|
140 LOCATE 11,35:PRINT"--"
|
|||
|
150 LOCATE 13,1:PRINT"--------------"
|
|||
|
160 A=0
|
|||
|
170 A$=INKEY$:IF A$="" THEN GOTO 170
|
|||
|
180 IF A=0 THEN WAHL=VAL(A$)*10:LOCATE 11,35:PRINT A$
|
|||
|
190 IF A=1 THEN WAHL=VAL(A$)+WAHL:LOCATE 11,36:PRINT A$
|
|||
|
200 A=A+1
|
|||
|
210 IF A=2 THEN GOTO 230
|
|||
|
220 GOTO 170
|
|||
|
230 REM
|
|||
|
240 IF WAHL=1 THEN GOTO 320
|
|||
|
250 IF WAHL=2 THEN
|
|||
|
260 IF WAHL=3 THEN
|
|||
|
270 IF WAHL=4 THEN GOTO 610
|
|||
|
280 IF WAHL=5 THEN
|
|||
|
290 LOCATE 13,1:PRINT"Falscheingabe!"
|
|||
|
300 FOR Z=0 TO 9000:NEXT
|
|||
|
310 LOCATE 1,1:A=-1:GOTO 30
|
|||
|
320 REM WAHL=1
|
|||
|
330 LOCATE 5,1:COLOR 31:PRINT"01 - Uhr"
|
|||
|
340 FOR Z=0 TO 20000:NEXT
|
|||
|
350 CLS
|
|||
|
360 COLOR 14
|
|||
|
370 A=0
|
|||
|
380 A=A+1
|
|||
|
390 H$=LEFT$(TIME$,2)
|
|||
|
400 M$=MID$(TIME$,4,2)
|
|||
|
410 S$=RIGHT$(TIME$,2)
|
|||
|
420 H=VAL(H$)
|
|||
|
430 M=VAL(M$)
|
|||
|
440 S=VAL(S$)
|
|||
|
450 MS=M+(S/100)
|
|||
|
460 IF A=1 THEN V=S
|
|||
|
470 IF V+1=60 THEN V=-1
|
|||
|
480 IF V+1=S THEN GOTO 500
|
|||
|
490 GOTO 380
|
|||
|
500 LOCATE 12,36
|
|||
|
510 IF S=15 OR S=45 THEN SOUND 500,1:GOTO 590
|
|||
|
520 IF S=30 THEN SOUND 1000,1:GOTO 590
|
|||
|
530 IF S=0 THEN SOUND 3000,1:GOTO 590
|
|||
|
540 IF M=30 AND C=0 THEN SOUND 3000,10:C=C+1
|
|||
|
550 IF M=60 AND D=0 THEN SOUND 1000,10:D=D+1
|
|||
|
560 IF H=12 AND E=0 THEN SOUND 2000,10:E=E+1
|
|||
|
570 IF H=0 AND F=0 THEN SOUND 2000,10:F=F+1
|
|||
|
580 SOUND 2000,1
|
|||
|
590 PRINT USING"##:##.##";H;MS
|
|||
|
600 GOTO 370
|
|||
|
610 REM int. Uhr stellen
|
|||
|
620 LOCATE 8,1:COLOR 31:PRINT"04 - int. Uhr stellen"
|
|||
|
630 FOR Z=0 TO 20000:NEXT Z
|
|||
|
640 COLOR 15
|
|||
|
650 CLS
|
|||
|
660 PRINT"Interne Uhr stellen:"
|
|||
|
670 PRINT
|
|||
|
680 PRINT"Geben Sie die genaue Uhrzeit ein:"
|
|||
|
690 PRINT" Format: HH:MM.SS (im 24h Format)"
|
|||
|
700 PRINT
|
|||
|
710 INPUT"Neue Uhrzeit: ",TIM$
|
|||
|
720 T1$=LEFT$(TIM$,2)
|
|||
|
730 T2$=MID$(TIM$,4,2)
|
|||
|
740 T3$=RIGHT$(TIM$,2)
|
|||
|
750 IF VAL(T1$)<0 OR VAL(T1$)>23 THEN GOTO 840
|
|||
|
760 IF VAL(T2$)<0 OR VAL(T2$)>59 THEN GOTO 840
|
|||
|
770 IF VAL(T3$)<0 OR VAL(T3$)>59 THEN GOTO 840
|
|||
|
780 IF LEN(TIM$)<>8 THEN GOTO 840
|
|||
|
790 IF MID$(TIM$,3,1)<>":" THEN GOTO 840
|
|||
|
800 IF MID$(TIM$,6,1)<>"." THEN GOTO 840
|
|||
|
810 LOCATE 6,15:COLOR 31:PRINT TIME$
|
|||
|
820 COLOR 12:PRINT"Zeit gestellt!"
|
|||
|
830 GOTO 10
|
|||
|
840 REM Zeitstellerror!!!
|
|||
|
850 CLS
|
|||
|
860 COLOR 12
|
|||
|
870 PRINT"LER *** FEHLER *** FEHLER *** FEHLER *** FEHLER *** FEHLER *** FEHLER *** FEH"
|
|||
|
880 PRINT
|
|||
|
890 PRINT"Beim Uhrstellen ist ein FEHLER aufgetreten!!!"
|
|||
|
900 PRINT"Der Wert ";TIM$;" ist ung<6E>ltig !!!"
|
|||
|
910 PRINT"Bitte geben Sie die Zeit nocheinmal ein."
|
|||
|
920 PRINT
|
|||
|
930 COLOR 10:PRINT"Mit Tastendruck geht's weiter"
|
|||
|
940 A$=INKEY$:IF A$="" THEN 940
|
|||
|
950 COLOR 15
|
|||
|
960 GOTO 650
|
|||
|
|