THE FOLLOWING CODE WILL REMOVE A PRINTER TABLE FROM IDDBD: 00010 REM "PROGRAM TO REMOVE PRINTER TABLE CSPPRNTR 00020 BEGIN 00030 OPEN (5) "IDDBD" ! OPENS IDDBD FILE 00040 PRINT 'CS' 00050 INPUT (0,LEN=5) "ENTER TABLE TO REMOVE: ",A$ ! ALLOWS USER TO CHOOSE ! WHICH PRINTER TO ! REMOVE 00060 A$=PAD(A$,6) ! PADS VARIABLE TO KEY SIZE 00070 READ RECORD (5,KEY="p"+A$) B$ ! READS RECORD USING VARIABLE 00080 PRINT B$(2,6) ! REAFFIRMS USER CHOICE 00090 INPUT (0,LEN=1) "IS THIS CORRECT?",C$ 00100 IF C$="y" OR C$="Y" THEN ! IF CHOICE IS CORRECT REMOVE (5,KEY="p"+A$); ! THEN REMOVE HEADER READ RECORD (5,KEY=$FF$+"p"+A$+"A",DOM=00110) E$ ! READ TEXT RECORD ELSE ! ELSE GOTO 00050 ! CHOOSE CORRECT PRINTER FI 00110 D$=KEY(5); ! SET D$ EQUAL TO KEY WHILE D$(3,6)=A$; ! WHILE PRINTER NAME PART OF KEY REMOVE (5,KEY=D$); ! REMOVE RECORD D$=KEY(5); WEND; PRINT "YOUR TABLE HAS BEEN REMOVED" THE FOLLOWING CODE WILL COPY A PRINTER TABLE FROM IDDBD TO A FILE: 00010 REM "PROGRAM TO COPY PRINTER TABLE TO A FILE CSPRNTF 00020 BEGIN 00030 OPEN (5) "IDDBD" ! OPENS IDDBD FILE 00040 A$=FID(5) ! PLACES THE FILE ID DATA INTO A$ 00050 PRINT 'CS' 00060 PRINT "WHAT FILE NAME DO YOU WISH TO COPY THE PRINTER TO? ",N$ 00070 INPUT (0,LEN=8) "(PLEASE USE 8 CHARACTERS OR LESS)",N$ ! GET FILE NAME 00080 A$(4,6)=N$(1,6) ! PLACE FILE NAME INTO A$ 00090 A$(21,2)=N$(7,2) 00100 FILE A$ ! DEFINES A$ AS A FILE 00110 OPEN (6) N$ ! OPEN NEW FILE 00120 INPUT (0,LEN=5) "ENTER TABLE TO COPY: ",B$ ! CHOOSE PRINTER TABLE 00130 B$=PAD(B$,6) ! PADS VARIABLE TO KEY SIZE 00140 READ RECORD (5,KEY="p"+B$) C$ ! READS RECORD USING VARIABLE 00150 PRINT C$(2,6) ! REAFFIRMS USER CHOICE 00160 INPUT (0,LEN=1) "IS THIS CORRECT? ",D$ 00170 IF D$="y"OR D$="Y" ! IF CHOICE IS CORRECT WRITE RECORD (6,KEY="p"+B$) C$; ! WRITE TO FILE READ RECORD (5,KEY=$FF$+"p"+B$+"A",DOM=00180) E$ ! READ TEXT RECORD ELSE ! ELSE GOTO 00120 ! CHOOSE CORRECT PRINTER FI 00180 F$=$FF$ +"p"+B$+"A"; ! SET F$ EQUAL TO KEY WHILE F$(1,8)=$FF$+"p"+B$; ! WHILE PRINTER NAME PART OF KEY WRITE RECORD (6,KEY=F$) E$; ! WRITE TEXT RECORD TO FILE F$=KEY(5); ! SET F$ EQUAL TO KEY READ RECORD (5) E$; ! READ NEXT RECORD WEND; PRINT "YOUR TABLE HAS BEEN COPIED" THE FOLLOWING CODE WILL TAKE A PRINTER TABLE THAT HAS BEEN COPIED TO A FILE AND RETURN IT TO IDDBD: 00010 REM "PROGRAM TO COPY A FILE INTO THE PRINTER TABLE CSPPRNTT 00020 BEGIN 00030 OPEN (5) "IDDBD" ! OPENS IDDBD 00050 PRINT 'CS' 00060 PRINT "WHAT FILE NAME DO YOU WISH TO COPY TO THE PRINTER PRINTER?" 00070 INPUT (0,LEN=8) "(PLEASE USE 8 CHARACTERS OR LESS) ",N$ ! GET FILE NAME 00080 OPEN (6) N$ ! OPEN FILE WITH DATA 00090 B$=FKY(6) ! PLACES THE KEY INTO B$ 00100 READ RECORD (6,KEY=B$) A$ ! READS THE FIRST RECORD IN THE FILE 00110 WRITE RECORD (5,KEY=B$) A$ ! WRITES THE RECORD TO A PRINTER TABLE 00120 B$=KEY(6) ! SETS B$ TO THE NEXT KEY 00130 READ RECORD (6) C$ ! READ THE NEXT RECORD 00150 D$=B$(3,6) ! SETS D$ TO THE TABLE NAME 00160 IF B$(3,6)=D$ ! IF PRINTER NAME PART OF KEY WRITE RECORD (5,KEY=B$) C$; ! WRITE NEXT RECORD B$=KEY(6,END=00170); ! SET B$ EQUAL TO KEY GOTO 170 ON EOF READ RECORD (6) C$; ! READ THE NEXT RECORD D$=B$(3,6); ! SET PRINTER NAME TO B$(3,6) GOTO 00160 ! GO TO BEGINNING OF LINE FI ! ENDIF 00170 PRINT "YOUR TABLE HAS BEEN ADDED" ! PRINTER HAS BEEN ADDED 00010 REM "PROGRAM TO COPY A FILE INTO THE PRINTER TABLE DGPPRNTT 00020 BEGIN 00030 OPEN (5) "IDDBD" ! OPENS IDDBD 00050 PRINT 'CS' 00060 PRINT "WHAT FILE NAME DO YOU WISH TO COPY TO THE PRINTER PRINTER?" 00070 INPUT (0,LEN=8) "(PLEASE USE 8 CHARACTERS OR LESS) ",N$ ! GET FILE NAME 00080 OPEN (6) N$ ! OPEN FILE WITH DATA 00090 B$=FKY(6) ! PLACES THE KEY INTO B$ 00100 READ RECORD (6,KEY=B$) A$ ! READS THE FIRST RECORD IN THE FILE 00110 WRITE RECORD (5,KEY=B$) A$ ! WRITES THE RECORD TO A PRINTER TABLE 00120 B$=KEY(6) ! SETS B$ TO THE NEXT KEY 00130 READ RECORD (6) C$ ! READ THE NEXT RECORD 00150 D$=B$(3,6) ! SETS D$ TO THE TABLE NAME 00160 IF B$(3,6)=D$ ! IF PRINTER NAME PART OF KEY WRITE RECORD (5,KEY=B$) C$; ! WRITE NEXT RECORD B$=KEY(6,END=00170); ! SET B$ EQUAL TO KEY GOTO 170 ON EOF READ RECORD (6) C$; ! READ THE NEXT RECORD D$=B$(3,6); ! SET PRINTER NAME TO B$(3,6) GOTO 00160 ! GO TO BEGINNING OF LINE FI ! ENDIF 00170 PRINT "YOUR TABLE HAS BEEN ADDED" ! PRINTER HAS BEEN ADDED