REM MAILING SYSTEM TPYFILE$="SORT.FIL" FILE TPYFILE$ DIM FIRST$(40), LAST$(40), STREET$(40), CITY$(40) DIM ZIP$(40), AREA$(40), TEL$(40) ONE=1 CNT=ONE PRINT CHR$(26) PRINT "START OF UPDATE" 50 REM DATA ENTRY INPUT "ENTER FIRST NAME:";FIRST$(CNT) FIRST$(CNT)=FIRST$(CNT)+" " INPUT "ENTER LAST NAME:";LAST$(CNT) INPUT "ENTER STREET ADDRESS:";STREET$(CNT) INPUT "ENTER CITY/STATE:";CITY$(CNT) INPUT "ENTER POSTAL 'ZIP'";ZIP$(CNT) INPUT "ENTER TEL.AREA CODE";AREA$(CNT) INPUT "ENTER TELEPHONE NUMBER";TEL$(CNT) PRINT PRINT CNT PRINT FIRST$(CNT);LAST$(CNT) PRINT STREET$(CNT) PRINT CITY$(CNT);", ";ZIP$(CNT) PRINT "(";AREA$(CNT);") ";TEL$(CNT) PRINT IF FIRST$(CNT)="END " THEN 200 90 REM INPUT "ACCEPT(Y) ELSE REJECT(N): "; ANS$ IF ANS$="Y" THEN 100 IF ANS$="N" THEN 50 PRINT "PLS ENTER CORRECT OPTION" GOTO 90 100 REM BUMP UP COUNT PRINT "RECORD ACCEPTED" PRINT CNT=CNT+1 GOTO 50 200 REM COUNT UP AND SORT CNT=CNT-1 PRINT CNT;"ITEMS ENTERED" OFF=0 SET=1 TWO=2 FILLER$=" " PRINT "SORTING...", 500 REM SORT LASTCNT=CNT-1 IF LASTCNT=0 THEN 900 CNT=1 FLAG=OFF 550 REM SORT ITERATION L$=LAST$(CNT)+FILLER$ L$=LEFT$(L$,24) F$=FIRST$(CNT)+FILLER$ F$=LEFT$(F$,24) NAME1$=L$+F$ L$=LAST$(CNT+1)+FILLER$ L$=LEFT$(L$,24) F$=FIRST$(CNT+1)+FILLER$ F$=LEFT$(F$,24) NAME2$=L$+F$ IF NAME1$ <= NAME2$ THEN 600 GOSUB 700 600 CNT=CNT+1 IF CNT >LASTCNT THEN 800 GOTO 550 700 REM SWAP FIELDS ZLAST$=LAST$(CNT) ZFIRST$=FIRST$(CNT) ZSTREET$=STREET$(CNT) ZCITY$=CITY$(CNT) ZZIP$=ZIP$(CNT) ZAREA$=AREA$(CNT) ZTEL$=TEL$(CNT) LAST$(CNT)=LAST$(CNT+1) FIRST$(CNT)=FIRST$(CNT+1) STREET$(CNT)=STREET$(CNT+1) CITY$(CNT)=CITY$(CNT+1) ZIP$(CNT)=ZIP$(CNT+1) AREA$(CNT)=AREA$(CNT+1) TEL$(CNT)=TEL$(CNT+1) LAST$(CNT+1)=ZLAST$ FIRST$(CNT+1)=ZFIRST$ STREET$(CNT+1)=ZSTREET$ CITY$(CNT+1)=ZCITY$ ZIP$(CNT+1)=ZZIP$ AREA$(CNT+1)=ZAREA$ TEL$(CNT+1)=ZTEL$ FLAG=SET RETURN 800 REM CHECK END OF SORT IF FLAG=OFF THEN 900 FLAG=OFF CNT=ONE GOTO 550 900 REM WRITE OUT SORTED FILE FOR CNT=1 TO LASTCNT+1 PRINT #ONE; LAST$(CNT),FIRST$(CNT),STREET$(CNT),CITY$(CNT),\ ZIP$(CNT),AREA$(CNT),TEL$(CNT) PRINT LAST$(CNT), NEXT CNT PRINT #ONE; "END","END","END","END","END","END","END" END ^:î\§Â¦ ¯2ð\2´^!"¸^2º^Í·!ô ÍU>ÿ2î\1Š^*°]|µÂ½ !Ì^#6~§Ê´ +"^¯2^2ï\2š^2›^2º^<2^!"¸^!Í^"˜^ÍÔ=>Ã2 !2" "Ã2 TARBELL BAS