130 DIM RA(170),DEC(170),MAG(170),NAME$(170),MG(170),XC%(170),YC%(170)
140 HOME : VTAB 9: HTAB 5: INVERSE : PRINT "*** NIBBLE PLANETARIUM ***": NORMAL : PRINT : HTAB 11: PRINT "BY NELSON R. CAPES": PRINT : HTAB 2: PRINT "COPYRIGHT (C) 1985 BY MICROSPARC INC"
150 GOSUB 2760
160 GOSUB 1050: REM INITIALIZE ARRAYS
170 HOME
180 PRINT "BE SURE CAPS ARE LOCKED ON.": PRINT
190 INPUT "DO YOU WANT TO RESTORE AN OLD SETUP? ";A$
200 IF A$ = "N" THEN TF = 1: GOTO 270
210 IF A$ < >"Y" THEN PRINT G$;: VTAB PEEK(37): CALL -868: GOTO 190
220 EF = 1: ONERR GOTO 2350
230 VTAB 3: CALL -868: PRINT "FILE NAME (<RETURN> FOR CATALOG):": INPUT "";A$:NF = 1
240 IF LEN(A$) >0 THEN FOR NC = 1 TO LEN(A$):NA = ASC( MID$ (A$,NC,1)):NF = ((NA >64 AND NA <91) OR (NA = 46) OR (NA >47 AND NA <58)) AND NF = 1: NEXT : IF LEN(A$) >13 OR NF = 0 THEN VTAB 3: CALL -868: PRINT G$"INVALID NAME": FOR NC = 1 TO 1000: NEXT : GOTO 230
250 IF A$ = "" THEN HOME : PRINT D$"CATALOG": PRINT : INPUT "PRESS <RETURN> TO CONTINUE ... ";B$: HOME : GOTO 230
1720 IF LEN(T$) = 0 THEN VTAB 23: HTAB 1: CALL -958: GOTO 2220
1730 VTAB 24: HTAB 1: CALL -868
1740 FL = 0: FOR I = 1 TO NS
1750 IF NAME$(I) = T$ THEN FL = I:I = NS
1760 NEXT
1770 IF FL = 0 THEN 1850
1780 XP = XC%(FL):YP = YC%(FL): IF MG(FL) < >99 THEN VTAB 23: HTAB 1: CALL -868: HTAB 1: PRINT G$"STAR NOT VISIBLE": FOR I = 1 TO 500: NEXT I: GOTO 1710
1790 FOR Z = 1 TO 10: XDRAW 5 AT XP,YP
1800 FOR Y = 1 TO 200: NEXT Y
1810 XDRAW 5 AT XP,YP
1820 FOR X = 1 TO 200: NEXT
1830 NEXT Z
1840 GOTO 1710
1850 HTAB 1: VTAB 23: CALL -868: HTAB 1: PRINT G$"STAR NOT IN TABLES": FOR I = 1 TO 500: NEXT I: GOTO 1710
2080 IF MG(I) = 99 AND YC%(I) > = YP -1 AND YC%(I) < = YP +1 AND XC%(I) > = XP -1 AND XC%(I) < = XP +1 THEN VTAB 23: HTAB 1: CALL -868: PRINT "STAR IS - ";: INVERSE : PRINT NAME$(I): NORMAL :FL = I:I = NS
2090 NEXT I
2100 IF FL = 0 THEN VTAB 23: HTAB 1: CALL -868: PRINT G$"NO MATCH!"
2110 GOTO 1980
2120 XDRAW 5 AT XP,YP: RETURN
2130 IF S8 < >1 THEN 2220
2140 EF = 3: ONERR GOTO 2350
2150 GOSUB 2750: INPUT "SAVE FILE NAME: ";A$:NF = 1: IF LEN(A$) >0 THEN FOR NC = 1 TO LEN(A$):NA = ASC( MID$ (A$,NC,1)):NF = ((NA >64 AND NA <91) OR (NA = 46) OR (NA >47 AND NA <58)) AND NF = 1: NEXT : IF LEN(A$) >13 OR NF = 0 THEN VTAB 23: CALL -868: PRINT G$"INVALID NAME": GOSUB 2760: GOTO 2150
2160 IF LEN(A$) = 0 THEN POKE -16303,0: HOME : PRINT D$"CATALOG": PRINT : INPUT "PRESS <RETURN> TO CONTINUE ... ";B$: HOME : POKE -16304,0: VTAB 21: PRINT "LONG "LNH" DEG "LGM" MIN LAT "LT" DEG": PRINT TAB( 16)"DATE "MN"/"DAY: GOTO 2150
2240 GOSUB 2750: PRINT "LOAD FILE NAME (<RETURN> FOR CATALOG): ": INPUT "";A$:NF = 1
2250 IF LEN(A$) >0 THEN FOR NC = 1 TO LEN(A$):NA = ASC( MID$ (A$,NC,1)):NF = ((NA >64 AND NA <91) OR (NA = 46) OR (NA >47 AND NA <58)) AND NF = 1: NEXT : IF LEN(A$) >13 OR NF = 0 THEN VTAB 23: CALL -868: PRINT G$"INVALID NAME": GOSUB 2760: GOTO 2240
2260 IF A$ = "" THEN HOME : PRINT D$"CATALOG": PRINT : INPUT "PRESS <RETURN> TO CONTINUE ... ";B$: HOME : GOTO 2240
2270 IF LEFT$(A$,2) = "P." THEN A$ = MID$ (A$,3)
2280 PRINT D$"VERIFY P."A$
2290 PRINT D$"OPEN P."A$
2300 PRINT D$"READ P."A$
2310 INPUT LNH,LGM,LT,MN,DAY,LST,HR,MIN,HZ$
2320 PRINT D$"CLOSE P."A$
2330 TF = 0:SEC = 0: POKE 216,0: RETURN
2340 REM ERROR HANDLING
2350 ER = PEEK(222):EL = PEEK(218) +256 * PEEK(219): CALL -3288: PRINT D$"CLOSE": TEXT : HOME : VTAB 12: IF ER = 6 THEN PRINT "FILE NOT ON THIS DISK": GOTO 2430
2360 IF (ER = 254 OR ER = 5) AND EF = 5 THEN PRINT "ERROR IN STAR.TABLE": PRINT : PRINT "LAST STAR READ SUCCESSFULLY WAS:": PRINT : PRINT NAME$(J -1): GOTO 2430
2370 IF ER = 4 AND EF = 3 THEN PRINT "THIS DISK IS WRITE-PROTECTED.": GOTO 2430
2380 IF (ER = 4 OR ER = 6) AND EF < >3 THEN PRINT "FILE NOT ON THIS DISK": GOTO 2430
2390 IF ER = 9 THEN PRINT "THIS DISK IS FULL.": GOTO 2430
2400 IF ER = 10 THEN PRINT "THE SPECIFIED FILE IS LOCKED.": GOTO 2430
2410 IF ER = 8 THEN PRINT "I/O ERROR. CHECK DRIVE DOOR.": GOTO 2430
2420 PRINT "ERROR #"ER" IN LINE "EL"."
2430 PRINT : GOSUB 2760: HOME : ON EF GOTO 190,1060,2140,2230,620
2440 VTAB 24: PRINT "I-J-K-M POSITION <RETURN> <ESC>APE";: RETURN