*
* LAB/MAI 8/23/83 BY R. SHIPP (460-9353)
ERASE
? '==============================================='
?
? ' MAILING LABEL PROGRAM'
? ' ---------------------'
?
? ' 1 = CONTINUE'
?
? ' / = EXIT BACK TO MENU'
?
? 'ENTER ONE OF THE ABOVE'
?
? '=============================================='
WAIT TO TEMP
IF TEMP='/'
   USE
   DO MENU
ENDIF
DO INDEX
DO LABTES
USE B:&FILE INDEX A:&IFILE
DO CODSEL
STORE STR(#,4) TO RECORD
STORE 0 TO T1
STORE 0 TO T2
STORE 0 TO T3
STORE 0 TO COUNT
SET MARGIN TO 6
STORE T TO TEST
DO WHILE TEST
ERASE
? '============================================='
?
? 'MAILING LABEL CAN BE ADDRESS AS FOLLOW:'
?
? '    1 = TO FAMILY UNIT (THE SHIPP FAMILY'
? '        -OR- RALPH SHIPP IF AN INDIVIDUAL'
? '        PERSON)'
?
? '    2 = TO THE INDIVIDUAL PERSON'
? '        ( RALPH SHIPP )'
?
? 'NOTE: (A) WE WILL USE TWO UP LABEL PAPER'
? '====  AND WILL PRINT TWO EACH OF THE SAME LABEL'
? '      TO SAVE ON COUMPUTER TIME.'
?
? '      (B) WILL NOT PRINT LABEL IF NO ZIP CODE IS'
? '      IN THE FILE NOW.'
?
? '      (C) LOAD THE PRINTER WITH TWO PAPER NOW'
?
? 'ENTER ONE OF THE ABOVE NUMBERS'
? '============================================'
WAIT TO TYPE
DO CASE
   CASE TYPE = '1'
      STORE F TO TEST
      LOOP
   CASE TYPE = '2'
      STORE F TO TEST
      LOOP
OTHERWISE
   DO NOGOOD
   LOOP
ENDCASE
ENDDO
DO WHILE.NOT.EOF
SET PRINT OFF
STORE ' ' TO MNAMEL
STORE ' ' TO MNAMEF
STORE ' ' TO MSTREET
STORE ' ' TO MCITY
STORE ' ' TO MSTATE
STORE ' ' TO MZIP
STORE ' ' TO L1
STORE ' ' TO L2
STORE ' ' TO L3
STORE ' ' TO L4
IF TYPE ='1'
    STORE ' ' TO FH
    STORE ($(CODEF,8,1)) TO FH
    IF FH <>'1'
        SKIP
        LOOP
    ENDIF
ENDIF
STORE ' ' TO TEMP
STORE (0) TO TEMPL
STORE TRIM(ZIP) TO TEMP
STORE LEN(TEMP) TO TEMPL
IF TEMPL<5
   SKIP
   LOOP
ENDIF
IF *
   SKIP
   LOOP
ENDIF
IF CHECKING = T
   STORE T TO CHECK
ELSE
   STORE F TO CHECK
ENDIF
DO WHILE CHECK .AND. .NOT. EOF
DO CASE
CASE C1 $ CODES
CASE C2 $ CODES
CASE C3 $ CODES
CASE C4 $ CODES
CASE C5 $ CODES
CASE C6 $ CODES
OTHERWISE
   SKIP
   LOOP
ENDCASE
STORE F TO CHECK
ENDDO
STORE STR(#,4) TO RECORD
STORE TRIM(NAMEL) TO MNAMEL
STORE TRIM(NAMEF) TO MNAMEF
STORE STREET TO MSTREET
STORE TRIM(CITY) TO MCITY
STORE STATE TO MSTATE
STORE ZIP TO MZIP
IF MZIP='20853'
   STORE T1+1 TO T1
ENDIF
IF MZIP='20902'
   STORE T2+1 TO T2
ENDIF
IF MZIP='20906'
   STORE T3+1 TO T3
ENDIF
IF TYPE = '1'
   STORE ' ' TO CODEFB
   STORE '*' TO CODEFH
   STORE ($(CODEF,1,6)) TO MCODEFB
   SKIP
   STORE ($(CODEF,1,6)) TO MCODEFH
   DO CASE
      CASE MCODEFB=MCODEFH
         STORE 'THE' TO FP
         STORE 'FAMILY' TO SP
         STORE (FP+' '+MNAMEL+' '+SP) TO L1
   OTHERWISE
         STORE (MNAMEF+' '+MNAMEL) TO L1
   ENDCASE
ELSE
   STORE (MNAMEF+' '+MNAMEL) TO L1
   SKIP
ENDIF
DO WHILE LEN(L1)<34
   STORE (L1+' ') TO L1
   LOOP
ENDDO
STORE MSTREET TO L2
STORE (MCITY+' '+MSTATE) TO L3
DO WHILE LEN(L3)<34
   STORE (L3+' ') TO L3
   LOOP
ENDDO
STORE MZIP TO L4
SET PRINT ON
? L1+'  '+L1
? L2+'             '+L2
? L3+'  '+L3
? L4+'                           '+L4
?
?
SET PRINT OFF
STORE (COUNT+1) TO COUNT
ENDDO
USE
SET PRINT ON
? 'DATE OF RUN = '+DATE()
? 'NUMBER OF 20853 ZIP = '+STR(T1,4)
? 'NUMBER OF 20902 ZIP = '+STR(T2,4)
? 'NUMBER OF 20906 ZIP = '+STR(T3,4)
? 'TOTAL NUMBER OF LABELS = '+STR(COUNT,4)
?
SET PRINT OFF
DO MENU
* THE END -- LAB/MAI
*

