1000 '"LONGZONE" Converts a time to local & GMV time
1010 ' By Robert Hamilton
1020 PROG1$="        L O N G Z O N E        "
1030 REV$ = "          Rev: 830120          "
1040 PROG2$="      By Hamilton Company      "
1050 SCREEN 0,0,0:WIDTH 80:COLOR 2,0,0:KEY OFF:CLS:UP$=STRING$(1,30)
1060 LOCATE ,,1,12,13:DEF SEG=0:IF PEEK (&H410)= 109 THEN LOCATE ,,,6,7
1070 DEF SEG=64:POKE 23,128:DEF SEG:CL$=STRING$(79,0):Q$=CHR$(34)
1080 PROG4$="NOTE: This program calculates Local and Universal Time for any Longitude"
1090      REM: ?? KEYS
1100 FOR I=1 TO 10:ON KEY(I) GOSUB 0 : KEY(I) ON: NEXT
1110 KEY OFF: KEY 1,CHR$(27)+"CLS:LIST  "
1120 KEY 2,CHR$(27)+"RUN  "+CHR$(7):KEY 3,CHR$(27)+"LOAD"+CHR$(7)+CHR$(34)
1130 KEY 4,CHR$(27)+"SAVE"+CHR$(34):KEY 5,CHR$(27)+"RUN"+CHR$(7)+CHR$(34):KEY 6,CHR$(27)+"GOTO 1000"
1140 KEY 7,CHR$(27)+CHR$(12)+"FILES "+CHR$(34)+"A:*.*":KEY 8,CHR$(27)+"RENUM 1000"
1150 KEY 9,CHR$(12)+"COLOR 6,0:CLS"+CHR$(13):KEY 10,CHR$(27)+"RUN"+CHR$(34)+"AUTOST"+CHR$(7)
1160 ON ERROR GOTO 1360
1170      REM: ?? TITLE
1180 CLS:LOCATE 3,25:PRINT CHR$(213)+STRING$(31,205)+CHR$(184)
1190 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1200 PRINT TAB(25);CHR$(179);:COLOR 6,0:PRINT PROG1$;:COLOR 2,0:PRINT CHR$(179)
1210 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1220 PRINT TAB(25);CHR$(179);REV$;CHR$(179)
1230 PRINT TAB(25);CHR$(179)+STRING$(31,32)+CHR$(179)
1240 PRINT TAB(25);CHR$(212)+STRING$(31,205)+CHR$(190)
1250 PRINT CHR$(10);TAB(26);PROG2$
1260 COLOR 6,0:LOCATE 20,1:PRINT PROG4$;
1270 LOCATE 24,1:COLOR 0,7:PRINT" SPACE ";:COLOR 5,0:PRINT" To Continue   ";
1280 COLOR 0,7:PRINT" Q ";:COLOR 5,0:PRINT" Quit Program ";:COLOR 6,0
1290 K$=INKEY$:IF MID$(K$,1,1)="Q" OR MID$(K$,1,1)="q" THEN 1330
1300 IF K$="" THEN 1290
1310 GOTO 1380
1320    REM ?? EXIT
1330 CLS:LOCATE 23,1:COLOR 6,0:PRINT"DONE";CHR$(10):KEY ON:BEEP:END
1340    REM ?? RETURN
1350 RETURN
1360    REM ?? ERROR
1370 CLS:BEEP:LOCATE 23,1:COLOR 12,0:PRINT"ERROR: ";:COLOR 6,0:KEY ON:ON ERROR GOTO 0
1380    REM ?? START Program
1390 CLS:LOCATE 24,1:COLOR 6,0:PRINT"San Francisco, Calif. Longitude = 122"
1400 COLOR 10,0:PRINT "ENTER Longitude (Deg ' Min)....(- East)....(Q = Quit): ===> ";
1410 COLOR 6,0:LINE INPUT "",D$
1420 IF D$="q" OR D$="Q" THEN 1330
1430 IF D$="" THEN BEEP:GOSUB 1690:GOTO 1400
1440 SEP=INSTR(D$,"'"):IF SEP=0 THEN D=VAL(D$):M=0:GOTO 1470
1450 D=VAL(LEFT$(D$,SEP-1)):M$=MID$(D$,SEP+1):IF M$="" THEN 1470
1460 M=VAL(M$)
1470 IF D>180 OR D<-180 OR M<-60 OR M>60 OR S<-60 OR S>60 THEN BEEP: GOSUB 1690:GOTO 1400
1480 COLOR 10,0:PRINT "ENTER Time (Hours : Minutes)...(24 Hour)...(Q = Quit): ===> ";
1490 COLOR 6,0:LINE INPUT "",H$
1500 IF H$="q" OR H$="Q" THEN 1330
1510 IF H$="" THEN BEEP:GOSUB 1690:GOTO 1480
1520 SEP=INSTR(H$,":"):IF SEP=0 THEN H=VAL(H$):M1=0:GOTO 1550
1530 H=VAL(LEFT$(H$,SEP-1)):M1$=MID$(H$,SEP+1):IF M1$="" THEN 1550
1540 M1=VAL(M1$)
1550 IF H<0 OR H>24 OR H<>INT(H) OR M1<0 OR M1>60 THEN BEEP: GOSUB 1690:GOTO 1480
1560 L=D+(M/60):L1=L-7.5
1570 T=INT(L1/15)+1:TL=(H-T+24) MOD 24:TZ=(H+T+24) MOD 24
1580 COLOR 4,0:PRINT CHR$(10);"TIME:";TAB(10);"LOCAL STANDARD";TAB(30);"LOCAL DAYLIGHT";TAB(50);"UNIVERSAL COORDINATED (GMT)":COLOR 6,0
1590 HR$=MID$(STR$(H),2):IF H<10 THEN HR$="0"+MID$(STR$(H),2)
1600 HR2$=MID$(STR$(H+1),2):IF H+1<10 THEN HR2$="0"+MID$(STR$(H+1),2)
1610 HR3$=MID$(STR$(TL+1),2):IF TL+1<10 THEN HR3$="0"+MID$(STR$(TL+1),2)
1620 MIN$=MID$(STR$(M1),2):IF M1<10 THEN MIN$="0"+MID$(STR$(M1),2)
1630 TL$=MID$(STR$(TL),2):IF TL<10 THEN TL$="0"+MID$(STR$(TL),2)
1640 TZ$=MID$(STR$(TZ),2):IF TZ<10 THEN TZ$="0"+MID$(STR$(TZ),2)
1650 PRINT TAB(11);HR$;":";MIN$;TAB(31);HR2$;":";MIN$;TAB(51);TZ$;":";MIN$
1660 PRINT TAB(11);TL$;":";MIN$;TAB(31);HR3$;":";MIN$;TAB(51);HR$;":";MIN$
1670 PRINT:GOTO 1400
1680 END
1690 PRINT UP$;CL$;:LOCATE ,1:RETURN