1 '---- INFORMATION AND REMARKS
100 '-- DEFINE VARIABLES AND COMMON VARIABLES
110 DEFINT A-Z
120	DIM IN$(20)
121	DIM RECORD$(30)
122	DIM CCC$(128)
150	FALSE  = 0
160     TRUE  = -1
200 '-- CONSOLE INITIALIZATION AND ROUTINES
201	WIDTH 255
204	XXXX = 0
205	YYYY = 0
206	ALT$        = CHR$(27) + "S"+CHR$(0)+CHR$(85)		'SCREEN TO COLUMN 53, ROW 0
207	REG$        = CHR$(27) + "S"+CHR$(0)+CHR$(25)		'SCREEN TO COLUMN 7, ROW 0
208	CLS$        = CHR$(26) + CHR$(27)+"S"+CHR$(0)+CHR$(32)	'CLEAR SCREEN AND SET TO COLUMN 0, ROW 0
209	CL1$        = CHR$(26) + CHR$(27)+"S"+CHR$(0)+CHR$(25)	'CLEAR SCREEN AND SET TO COLUMN 7, ROW 0
210	G1$         = CHR$(27) + "g"				'TURN GRAPHICS ON
211	G0$         = CHR$(27) + "G"				'TURN GRAPHICS OFF
212	U1$         = CHR$(27) + "l"				'TURN UNDERLINING ON
213	U0$         = CHR$(27) + "m"				'TURN UNDERLINING OFF
214	H1$         = CHR$(27) + ")"				'TURN HALF INTENSITY DISPLAY ON
215	H0$         = CHR$(27) + "("				'TURN HALF INTENSITY DISPLAY OFF
216	CRSRMOVE$   = CHR$(27) + "="+CHR$(YYYY)+CHR$(XXXX+32)	'MOVES CRSR TO POSITION XXXX,YYYY
217	CRSRLEFT$   = CHR$(8)					'CRSR LEFT w/o ERASE
218	CRSRRIGHT$  = CHR$(12)					'CRSR RIGHT w/o ERASE
219	DEL1$       = CHR$(27) + "W"				'DELETE CHARACTER AT CRSR POSITION
220	CRSRUP$     = CHR$(11)					'CRSR UP
221	CRSRDOWN$   = CHR$(10)					'CRSR DOWN
222	RTN$        = CHR$(13)					'CARRIAGE RETURN
223	INSERT$     = CHR$(27) + "Q"				'INSERTS CHARACTER AT CRSR POSSTION
224	INSERTLINE$ = CHR$(27) + "E"				'INSERT LINE AT CRSR LINE
240	HOME$       = CHR$(27) + CHR$(61)+CHR$(1)+CHR$(32) 	'CURSOR TO  0,1 (X,Y)
260	R$          = CHR$(13) + CHR$(10) 			'CARRIAGE RETURN AND LINE FEED
270	CLRLIN$     = CHR$(13) + CHR$(27)+CHR$(84) 		'RETURN CURSOR AND CLEAR LINE
280	HLFCLR$     = CHR$(27) + "T"				'CLEARS LINE TO LEFT OF CURSOR
290 DEF FNCRSRMV$(XX,YY) = CHR$(27)+"="+CHR$(YY+32)+CHR$(XX+32)	
291 DEF FNSCRNMV$(XX,YY) = CHR$(27)+"S"+CHR$(YY+32)+CHR$(XX+32)
300 '-- PRINTER INITIALIZATION AND ROUTINES
310	WIDTH LPRINT 255
315	E$          = CHR$(27)           			'ESCAPE
320	RS$         = CHR$(27)+CHR$(13)+"P"			'EXTERNAL RESET
325	SP$         = CHR$(32)           			'SPACE
330	LF$         = CHR$(10)           			'LINE FEED
335	NF$         = CHR$(27) + CHR$(10)			'NEGATIVE LINE FEED
340	G$          = CHR$(51)           			'3
345	TX$         = CHR$(52)           			'4
350	PP$         = "."                			'PERIOD (PRINT CHARACTER)
355	BS$         = CHR$(8)            			'BACKSPACE
360	BW$         = CHR$(27) + "6"     			'BACKWARD PRINT MODE ON
365	RV$         = CHR$(27) + "<"     			'REVERSE PRINTING MODE
370	CR$         = CHR$(13)+E$+G$     			'CARRIAGE RETURN WITH GRAPHICS RESET
400 '-- 400-799 RESERVED FOR LIBRARY EXPANSION
800 '-- ERROR RECOVERY ROUTINES
801	ON ERROR GOTO 803
802	GOTO 1000
803 '-- BEGINNING OF ERROR TRAP
804	IF ERR = 53 AND ERL = 1490 THEN NFFL = TRUE:

                                        RESUME NEXT
806	IF ERR = 62 AND ERL = 1560 THEN PRINT R$;U1$;H1$;"INPUT PAST END";U0$;H0$:

                                        RESUME 1625
808	IF ERR = 58 AND ERL = 2280 THEN GOSUB 910 : 

					RESUME NEXT
810	IF ERR = 58 AND ERL = 1594 THEN PRINT R$;U1$;H1;"KILLING ";FLNM1$;".BAK";U0$;H0$:

					KILL FLNM1$+".BAK":

					RESUME
814	IF ERR = 53 AND ERL = 1570 THEN PRINT R$;U1$;H1$;"FILE NOT FOUND";H0$;U0$:

					RESUME 1625   'FILE NOT FOUND
899	ON ERROR GOTO 0
900 '-- ADDITIONAL ERROR RECOVERY SUBROUTINES
910	PRINT R$;U1$;"FILE ";FLNM1$;".IRS ALREADY EXISTS";U0$
912	QU$ = H1$ + "OVERWRITE FILE? " + H0$
914	GOSUB 2690
915	IF FL THEN PRINT R$;U1$;"OVERWRITING ";FLNM1$;".IRS";U0$:

		   KILL FLNM1$+".IRS" :

		   RESUME 

	      ELSE NAME FLNM1$+".$$$" AS FLNM1$+".XXX"  :

	    	   PRINT R$;U1$;"SAVING FILE AS ";FLNM1$;".XXX";U0$:

		   RESUME NEXT
1000 '- BEGINNING OF MAIN BODY OF PROGRAM
1010 '- PROGRAM ENTERIRS.BAS  11/28/81
1020 PRINT CLS$;
1030 PRINT "Use  this program to write IRS format files to  disk"
1040 PRINT "or to add to an existing IRS file.   If the IRS file"
1050 PRINT "has  already been indexed by IRS as a .D00 type file"
1060 PRINT "then  it  will be renamed with the  extension  .IRS."
1070 PRINT "The old file will be saved with the extension  .BAK."
1080 PRINT "It will overwrite a previous .IRS type file with the"
1090 PRINT "same name."
1100 PRINT
1110 PRINT "Two disks must be inserted for this program to  run,"
1120 PRINT "since it searches both disks."
1130 PRINT
1140 PRINT "Press any key to continue"
1142 AAAA$ = INKEY$ : IF AAAA$ = "" THEN 1142
1150 PRINT CLS$;
1160 PRINT R$;
1180 WIDTH 52
1190 PRINT U1$;"DRIVE A:";U0$;H1$;R$ 
1200 FILES "A:*.*"
1210 PRINT H0$;
1220 PRINT R$;R$;U1$;"DRIVE B:";U0$;H1$;R$ 
1230 FILES "B:*.*"
1240 PRINT H0$;
1250 WIDTH 255
1260 PRINT R$    
1270 UCFL = TRUE
1280 FLFL = TRUE
1285 NFFL = FALSE
1286 PRINT FNCRSRMV$(0,21);
1290 PRINT H1$;"DRIVE A or B?  (X to EXIT):";H0$;
1300 LN = 1
1305 OFFSET = 28
1306 RECNO = 20
1310 GOSUB 2320 : IF CC$ <> "A" AND CC$ <> "B" AND CC$ <> "X" THEN PRINT CRSRLEFT$; : GOTO 1310 ELSE DSK$ = CC$ + ":"
1320 IF CC$ = "X" THEN PRINT CLS$; : GOTO 2285
1330 PRINT R$;
1340 PRINT H1$;"                 FILE NAME:";H0$;
1350 LN = 8
1355 RECNO = 21
1360 GOSUB 2320 : FLNM1$ = CC$
1365 PRINT R$;
1370 PRINT H1$;"            FILE EXTENSION:";H0$;
1380 LN = 3
1385 RECNO = 22
1390 GOSUB 2320 : FLNM2$ = CC$
1400 UCFL = 0
1410 FLFL = 0
1415 IF FLNM2$="$$$" OR FLNM2$="BAK" THEN PRINT CLS$;U1$;"EXTENSION .";FLNM2$;" NOT ACCEPTABLE. TRY AGAIN";U0$;R$;:

					  GOTO 1160
1420 IF FLNM2$ = "" THEN FLNM$ = FLNM1$ ELSE FLNM$ =FLNM1$ + "." + FLNM2$
1430 IF FLNM$ = "" THEN 1350 ELSE FLNM$ = DSK$ + FLNM$ : FLNM1$ = DSK$ + FLNM1$
1440 QU$ = H1$ + FLNM$ + " is OK? (Y or N) " + H0$
1450 PRINT R$
1460 GOSUB 2680
1470 IF NOT FL THEN PRINT CLS$;: GOTO 1150
1480 PRINT CLS$;
1490 OPEN "I",#1,FLNM$
1492 IF NFFL THEN PRINT R$;U1$;"NEW FILE ";FLNM$;" WILL BE ";FLNM1$;".IRS";U0$:

		  OPEN "O",#2,FLNM1$+".$$$":

		  PRINT U1$;"OPENING ";FLNM1$;".$$$ ";U0$: 

		  GOTO 1625

	     ELSE PRINT R$;U1$;"OPENING ";FLNM$;" AS INPUT FILE";U0$
1495 PRINT R$;U1$;"OPENING ";FLNM1$;".$$$ AS TEMPORARY FILE";U0$
1500 OPEN "O",#2,FLNM1$ + ".$$$"
1510 QU$ = R$ + H1$ + "DISPLAY OLD FILE "+FLNM$+"? " + H0$
1520 GOSUB 2690
1530 PRNFL = FL
1540 PRINT R$;R$;R$;
1550 PRINT U1$;"READING ";FLNM$;" INTO NEW ";FLNM1$;".$$$";U0$
1552 FOR I = 1 TO 128
1560	LINE INPUT #1,CCC$(I)
1570	IF EOF(1) THEN FFFL = -1 : GOTO 1578
1571 NEXT I
1572 IF I >= 128 THEN I = 128
1578 FOR J = 1 TO I
1580	IF PRNFL THEN PRINT CCC$(J)
1590	PRINT #2, CCC$(J)
1592 NEXT J
1594 IF FFFL THEN CLOSE#1:

                  PRINT R$;U1$;"CLOSING ";FLNM$;" AS ";FLNM1$;".BAK";U0$:

		  NAME FLNM$ AS FLNM1$+".BAK":

		  GOTO 1625
1600 GOTO 1552
1610 '______________________________________________
1620 'READ DATA ROUTINE
1625 PRINT R$;H1$;"PRESS ANY KEY TO CONTINUE";H0$;
1626 AAAA$ = INKEY$ : IF AAAA$ = "" THEN 1626
1630 NN = 19 ' number of data entries per record
1640 FOR RECNO = 1 TO NN
1650	READ IN$(RECNO)
1660	RECORD$(RECNO) = LEFT$(IN$(RECNO),LEN(IN$(RECNO))-5)
1670 NEXT RECNO
1680 '______________________________________________
1690 'DATA ENTRY ROUTINE
1700 PRINT CLS$;
1705 PRINT H1$;
1710 PRINT "  UP-Arrow : Previous Entry    LEFT-arrow  : Delete"
1715 PRINT U1$;
1720 PRINT "DOWN-Arrow : Delete Entry     RIGHT-arrow  : Immed  "
1725 PRINT U0$;
1740 FOR RECNO = 1 TO NN
1750	PRINT IN$(RECNO)
1760 NEXT RECNO
1770 PRINT H0$;
1776 XYZ = 1
1780 ATFL = FALSE
1785 UCFL = FALSE
1790 LN = 90 
1795 OFFSET = 18
1800 FOR RECNO = XYZ TO NN
1820	PRINT FNCRSRMV$(OFFSET,RECNO+1);
1840	GOSUB 2330 : IF ATFL = TRUE  THEN 1870 ELSE RECORD$(RECNO) = CC$
1860 NEXT RECNO
1865 ATFL = TRUE
1866 UCFL = FALSE 
1870 PRINT FNSCRNMV$(0,2);
1871 PRINT FNCRSRMV$(0,23);
1900 QU$ = H1$ + "ENTER NUMBER TO CHANGE--00 TO CONTINUE--99 TO EXIT" + H0$
1901 RECNO = 22
1902 OFFSET = 50
1950 GOSUB 2780: RECNO = NM
1952 IF ((RECNO > NN) AND (RECNO <> 99)) OR (RECNO < 0) THEN 1870
1960 IF RECNO = 0 THEN GOSUB 2070 : GOTO 1700
1965 IF RECNO = 99 THEN RECNO = 0 : GOSUB 2070 :GOTO 2240
1969 PRINT FNSCRNMV$(0,0);
2020 OFFSET = 18
2030 GOSUB 2330: RECORD$(RECNO) = CC$
2035 IF ATFL = FALSE THEN XYZ = RECNO : GOTO 1800
2040 GOTO 1870
2050 '_____________________________________________
2060 'PRINT TO FILE SUBROUTINE 
2070 PRINT#2,R$;"..";RECORD$(9);"*C";R$;
2080 FOR FLDNO = 1 TO NN-7
2090	PRINT#2,RECORD$(FLDNO);",";
2100	IF FLDNO = 4  THEN PRINT#2,R$;
2110	IF FLDNO = 10 THEN PRINT#2,R$;
2120 NEXT FLDNO
2130 PRINT#2,"*";R$;RECORD$(NN-6);R$;"*K ";
2140 FOR FLDNO = NN - 5 TO NN
2150	IF RECORD$(FLDNO) <> "" THEN PRINT#2,RECORD$(FLDNO);"/";
2160 NEXT FLDNO
2170 PRINT#2,"*E";R$;R$;
2175 RETURN
2180 '______________________________________________
2240 QU$ = "Exit `IRSENTRY' (Y or N)?"
2250 GOSUB 2680
2260 IF NOT FL THEN 1870
2265 PRINT CLS$;U1$;"CLOSING ALL FILES";U0$
2270 CLOSE
2275 PRINT R$;U1$;"NAMING ";FLNM1$;".$$$ AS ";FLNM1$;".IRS";U0$
2280 NAME FLNM1$+".$$$" AS FLNM1$+".IRS"
2285 QU$ = R$ + H1$ + "EXIT TO MBASIC? " + H0$
2290 GOSUB 2680
2292 IF FL THEN END
2294 QU$ = H1$ + "EXIT TO CP/M? " + H0$
2295 GOSUB 2680
2296 IF FL THEN SYSTEM
2300 GOTO 1000
2320 '______________________________________________
2330 ' subroutine for stringdata entry
2390 ' the entered string is returned as CC$
2400 PRINT FNCRSRMV$(OFFSET,RECNO+1);
2410 PRINT G1$;' graphics on
2412 PRINT H1$;
2420 PRINT STRING$(LN,127);
2450 PRINT G0$;' graphics off
2452 PRINT H0$;
2480 ' enter data and display it as entered
2485 PRINT FNCRSRMV$(OFFSET,RECNO+1);
2490 CC$=""
2500 J=0
2510 FOR I = 1 TO LN
2520	J = J + 1
2530	IF NOT FLFL AND RECNO => NN - 5 AND RECNO <= NN THEN UCFL = TRUE 
2540	C$  = INKEY$: IF C$ = "" THEN 2540
2542	IF C$ = RTN$ THEN 2660
2543	IF C$ = CHR$(11)  AND RECORD$(RECNO)  <> "" AND XXX=0 THEN C$=RECORD$(RECNO) ELSE IF C$ = CHR$(11)  THEN C$ = ""
2545	IF C$ <> "" THEN IF (UCFL = TRUE) THEN IF ((ASC(C$) >= 97) AND (ASC(C$) <= 122)) THEN C$ = CHR$(ASC(C$)-32)
2560	IF C$ = CHR$(8)  AND NOT CC$="" THEN PRINT CHR$(8);CHR$(27);"W";:CC$=LEFT$(CC$,LEN(CC$)-1):GOTO 2540
2570	IF C$ = CHR$(8) AND CC$ = "" THEN GOTO 2540
2580	IF C$ = CHR$(10) THEN PRINT FNCRSRMV$(OFFSET,RECNO+1);: GOTO 2410
2610	IF C$ = "," THEN C$ = ""
2615	IF C$ = CHR$(12)  THEN ATFL = NOT ATFL : CC$ = "" : C$ = "" : GOTO 2660
2620	IF C$ = "." AND FLFL = TRUE THEN 2660
2640	PRINT C$;:CC$=CC$ + C$
2650 NEXT I
2660 PRINT HLFCLR$;FNCRSRMV$(OFFSET,RECNO+1);
2670 RETURN
2680 '________________________________________________
2690 ' Subroutine Yes or NO
2700 PRINT CLRLIN$;
2710 PRINT QU$;
2720 YN$ = INKEY$: IF YN$ = "" THEN 2720
2730 IF YN$ = "y" OR YN$ = "Y" THEN PRINT "Y";:FL = -1:RETURN
2740 IF YN$ = "n" OR YN$ = "N"  THEN PRINT "N";:FL =  0:RETURN
2750 GOTO 2720
2760 RETURN
2770 '________________________________________________
2780 ' Subroutine returns 2-digit numeric input
2790 PRINT CLRLIN$;
2800 PRINT QU$;
2810 LN = 2
2820 XXX=1
2830 GOSUB 2320 : NM = VAL(CC$)
2840 XXX=0
2850 LN = 90
2870 RETURN
2880 '_______________________________________________
2940 'DATA SECTION
2950 DATA"    LAST NAME- 01:"
2960 DATA"   FIRST NAME- 02:"
2970 DATA"     POSITION- 03:"
2980 DATA" ORGANIZATION- 04:"
2990 DATA"    ADDRESS 1- 05:"
3000 DATA"    ADDRESS 2- 06:"
3010 DATA"         CITY- 07:"
3020 DATA"        STATE- 08:"
3030 DATA"          ZIP- 09:"
3040 DATA"   SALUTATION- 10:"
3050 DATA"      PHONE 1- 11:"
3060 DATA"      PHONE 2- 12:"
3070 DATA"        NOTES- 13:"
3080 DATA"   KEYWORD(S)- 14:"
3090 DATA"   KEYWORD(S)- 15:"
3100 DATA"   KEYWORD(S)- 16:"
3110 DATA"   KEYWORD(S)- 17:"
3120 DATA"   KEYWORD(S)- 18:"
3130 DATA"   KEYWORD(S)- 19:"
"
3100 DATA"   KEYWORD(S)- 16:"
3110 DAT