Source:Artifact Maintenance
Jump to navigation
Jump to search
This page is a verbatim reproduction of original source material and should not be edited except for maintenance. | |
Description |
The Applesoft BASIC source code of the Eamon utility program Artifact Maintenance, originally included on the Eamon Utilities I disk and later on the EAG Utilities Disk. |
---|---|
Source |
EAG Utilities Disk |
Date | |
Author | |
License |
The use of this item is permitted on the grounds that it's free or in the public domain. |
1 REM ARTIFACT MAINTENANCE
2 REM FOR EAMON
3 REM BY JOHN NELSON
4 REM
5 REM
7 REM 2/19/96
8 REM
10 D$ = CHR$ (4): TEXT : HOME
20 VTAB 6: PRINT " INSERT EAMON ADVENTURE DISKETTE AND": PRINT : PRINT SPC( 6);"PRESS ANY KEY TO CONTINUE ...";: GET A$: PRINT
25 PRINT D$"UNLOCK EAMON.DESC": PRINT D$"UNLOCK EAMON.ARTIFACTS"
30 PRINT D$"OPEN EAMON.DESC,L256": PRINT D$"READ EAMON.DESC,R0": INPUT NR,NA,NE,NM
40 DIM AN$(100),AD%(100,8)
50 PRINT D$"OPEN EAMON.ARTIFACTS,L128"
60 FOR A = 1 TO NA: PRINT D$"READ EAMON.ARTIFACTS,R";A: INPUT AN$(A): FOR A2 = 1 TO 4: INPUT AD%(A,A2): NEXT A2: IF AD%(A,2) = > 2 THEN FOR A2 = 5 TO 8: INPUT AD%(A,A2): NEXT
70 NEXT A: PRINT D$
100 HOME : PRINT SPC( 17);"EAMON": PRINT SPC( 9);"ARTIFACT MAINTENANCE": PRINT SPC( 12);"BY JOHN NELSON": VTAB 10: PRINT "SELECT ACTION:"
105 PRINT " 1. LIST ARTIFACTS": PRINT " 2. DELETE ARTIFACTS": PRINT " 3. INSERT ARTIFACTS": PRINT " 4. APPLY CHANGES TO FILE"
110 PRINT " 5. CANCEL CHANGES": PRINT " 6. QUIT"
120 PRINT "INPUT YOUR CHOICE (1-6):";
130 GET A$: IF VAL (A$) < 1 OR VAL (A$) > 6 THEN 130
160 PRINT A$: ON VAL (A$) GOTO 1000,2000,3000,4000,5000,6000
1000 REM /// LIST
1010 HOME :LP = 0: FOR A = 1 TO NA: PRINT " ";A;". ";AN$(A):LP = LP + 1: IF LP > 22 THEN PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT :LP = 0: HOME
1020 NEXT
1090 PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : GOTO 100
2000 REM /// DELETE
2010 VTAB 6: CALL - 958: INPUT "HOW MANY TO DELETE?";ND$: IF VAL (ND$) < 1 OR VAL (ND$) > NART THEN 2010
2020 VTAB 8: CALL - 958: INPUT "FIRST ARTIFACT TO DELETE:";D1$: IF VAL (D1$) < 1 OR VAL (D1$) > NART THEN 2020
2030 ND = VAL (ND$):D1 = VAL (D1$): HOME : PRINT "DELETE ARTIFACTS ";D1;" THRU ";D1 + ND - 1
2040 VTAB 6: PRINT "IS THIS CORRECT? (Y/N) ";
2045 GET A$: IF A$ < > "Y" AND A$ < > "N" THEN 2045
2048 PRINT A$: IF A$ = "N" THEN 100
2050 UP = 1: FOR D = D1 + ND TO NA: PRINT D$"READ EAMON.DESC,R";D + 100: INPUT RD$: PRINT D$"WRITE EAMON.DESC,R";D - ND + 100: PRINT CHR$ (34);RD$; CHR$ (34)
2060 AN$(D - ND) = AN$(D): FOR A2 = 1 TO 8:AD%(D - ND,A2) = AD%(D,A2): NEXT A2
2070 NEXT D: PRINT D$:NA = NA - ND
2080 GOTO 100
3000 REM /// ADD
3010 VTAB 6: CALL - 958: PRINT : INPUT "HOW MANY TO INSERT?";NI$: IF VAL (NI$) < 1 OR VAL (NI$) + NA > 100 THEN 3010
3020 VTAB 8: INPUT "AFTER WHICH ARTIFACT:";IA$: IF VAL (IA$) < 1 OR VAL (IA$) > NART THEN 3020
3030 HOME :NI = INT ( VAL (NI$)):IA = INT ( VAL (IA$)): PRINT "INSERT ";NI;" ARTIFACTS AFTER ";IA;"."
3040 VTAB 6: PRINT "IS THIS CORRECT? (Y/N) ";
3045 GET A$: IF A$ < > "Y" AND A$ < > "N" THEN 3045
3048 PRINT A$: IF A$ = "N" THEN 100
3050 UP = 1:X = 0: FOR I = NA + NI TO IA + 1 STEP - 1: PRINT D$"READ EAMON.DESC,R";I - NI + 100: INPUT RD$: PRINT D$"WRITE EAMON.DESC,R";I + 100: PRINT CHR$ (34);RD$; CHR$ (34)
3060 AN$(I) = AN$(NA - X): FOR A2 = 1 TO 8:AD%(I,A2) = AD%(IA + NI + 1,A2): NEXT A2
3070 X = X + 1: NEXT I: PRINT D$:
3080 FOR A = IA + 1 TO NI + IA:AN$(A) = "DUMMY": FOR A2 = 1 TO 8:AD%(A,A2) = 0: NEXT A2,A
3090 NA = NA + NI: GOTO 100
4000 REM /// APPLY
4010 FOR A = 1 TO NA: PRINT D$"WRITE EAMON.ARTIFACTS,R";A: PRINT AN$(A): FOR A2 = 1 TO 8: PRINT AD%(A,A2): NEXT A2,A
4030 PRINT D$"WRITE EAMON.DESC,R0": PRINT NR: PRINT NA: PRINT NE: PRINT NM: PRINT D$
4040 UP = 0
4090 GOTO 100
5000 REM /// CANCEL
5010 UP = NOT UP: PRINT "UPDATE IS "; MID$ ("CANCELLEDIN EFFECT",UP * 9 + 1,9): PRINT : PRINT "====== PRESS ANY KEY TO CONTINUE ======";: GET A$: PRINT : GOTO 100
6000 REM /// QUIT
6010 IF UP THEN PRINT : PRINT "UPDATE HAS NOT BEEN APPLIED.": PRINT : PRINT "PRESS ANY KEY TO CONTINUE";: GET A$: PRINT : GOTO 100
6020 PRINT D$"CLOSE"
6030 END