        REM NADMENU.BAS   * PROGRAM MENU FOR NAME & ADDRESS      *
        REM               * 2350
        REM 05 29 83      * J.BUTLER
        REM SYSTEM CONTROL PROGRAM NUMBER    :100
%CHAIN 300,20000,2650,1200
 
        REM COMMONS GO HERE
        COMMON CLEAR$,NAME$,LINE$,DEMO$,CRSR$,EOL$,DATE$,ID$,SCRPARA,EOS$
        COMMON ROWOFF,COLOFF,DIO
 
        REM DIMENSIONS GO HERE
        DIM MONTHS$(12),S(25)
        DIO=0DB00H:REV$="052983"
        FOR X=1 TO 25:READ S(X):POKE DIO-1+X,S(X):NEXT X
        MONTHS$(1)="JANUARY":MONTHS$(2)="FEBRUARY":MONTHS$(3)="MARCH"
        MONTHS$(4)="APRIL":MONTHS$(5)="MAY":MONTHS$(6)="JUNE"
        MONTHS$(7)="JULY":MONTHS$(8)="AUGUST":MONTHS$(9)="SEPTEMBER"
        MONTHS$(10)="OCTOBER":MONTHS$(11)="NOVEMBER":MONTHS$(12)="DECEMBER"
        BLANK$="........................................................":ERR=1
 
        IF END #1 THEN 9992
        OPEN "SCREEN.FIL" RECL 18 AS 1
        IF END #2 THEN 9992
        OPEN "COMPANY.DA" RECL 160 AS 2

1       REM OPEN ANY MORE FILES HERE
        REM  ** GET SCREEN PARAMETERS FROM SCREEN.FIL **
        READ #1,1;A$,B$,C$
        CLEAR$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,2;A$,B$,C$
        CRSR$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,3;A$,B$,C$
        EOS$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,4;A$,B$,C$
        EOL$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,5;A$,B$,C$
        CLRFORE$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,6;A$,B$,C$
        CLRBACK$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,7;A$,B$,C$
        HIGH$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,8;A$,B$,C$
        LOW$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,9;A$,B$,C$
        HOME$=CHR$(VAL(A$))+CHR$(VAL(B$))
        READ #1,13;A$,B$,C$
        ROWOFF=VAL(A$):COLOFF=VAL(B$):SCRPARA=VAL(C$)
        CLOSE 1
 
        REM MASK INITIALIZATION GOES HERE
 
        REM PASSWORD ROUTINE GOES HERE

7       GOTO 11
 
8       REM VERTICAL CURSOR POSITIONING ROUTINE
        FOR ZZ=1 TO VV:PRINT:NEXT ZZ:RETURN
 
9       REM DATE FORMATTING ROUTINE
        DATE$=MID$(P$,1,2)+"-"+MID$(P$,3,2)+"-"+MID$(P$,5,2)
        RETURN
 
10      REM  CURSOR ADDRESS
        IF SCRPARA=1 THEN \
        PRINT CRSR$;CHR$(ROW+ROWOFF);CHR$(COLUMN+COLOFF);:RETURN
        PRINT CRSR$;CHR$(COLUMN+COLOFF);CHR$(ROW+ROWOFF);:RETURN
 
11      REM GET DATE HERE
        READ #2,1;A2$,B2$,C2$,D2$,E2$,F2$,G2$,H2$,I2$,J2$
        NAME$=B2$:LINE$="":CONO$=I2$:ORG$=J2$
        FOR X=1 TO LEN(NAME$):LINE$=LINE$+"*":NEXT X
        P$=H2$:GOSUB 9
 
15      REM COMPANY INFO HERE
        GOTO 150        

93      REM  ** GET DATE AND ID AND TIME FROM OPERATOR **
        PRINT CLEAR$:VV=8:GOSUB 8:P=0
        PRINT TAB(20);"WHAT IS THE DATE (MMDDYY) : ";:INPUT "";LINE P$
        Q8=VAL(MID$(ORG$,5,2))
        IF VAL(MID$(P$,5,2))<Q8 THEN 93
        L=LEN(P$):Q9=ABS((18-VAL(MID$(P$,1,2)))-(18-VAL(MID$(ORG$,1,2))))
        IF L=6 AND Q9=6 THEN J2$=P$:GOSUB 2900:GOTO 95
        IF L=6 AND Q9<>6 THEN NOGO$="X":GOTO 95
        GOTO 93
 
95      REM ** IF SIX MONTHS HAVE PASSED THEN PRINT MESSAGE **
        PRINT #2,1;F1$,B2$,C2$,D2$,E2$,F2$,G2$,P$,I2$,J2$
        GOSUB 9

100     IF NOGO$="X" THEN GOSUB 4000
        GOTO 150
 
101     CHAIN "NADSCRN"
102     CHAIN "NADREPT"
103     CHAIN "NADMAIL"
104     CHAIN ""
105     CHAIN ""
106     CHAIN ""
107     CHAIN ""
108     CHAIN ""
109     CHAIN ""
110     GOTO 93
111     PRINT CLEAR$:STOP
     
150     GOSUB 2000:PRINT TAB(29);"* * * MAIN MENU * * *"
        PRINT:PRINT:PRINT:PRINT
        PRINT TAB (26);" 1. NAME & ADDRESS ENTRY"
        PRINT TAB (26);" 2. NAME & ADDRESS REPORT"
        PRINT TAB (26);" 3. MAILING LABELS"
        PRINT TAB (26);" 4. "
        PRINT TAB (26);" 5. "
        PRINT TAB (26);" 6. "
        PRINT TAB (26);" 7. CHANGE DATE"

155     COLUMN=14:ROW=22:GOSUB 10:PRINT EOS$;
        PRINT "TYPE THE NUMBER OF YOUR REQUEST : ";:Y%=CONCHAR%:Y=Y%-48
        IF Y%=94 THEN 9990
        IF Y=7 THEN 160
        IF Y<1 OR Y>3 THEN 155

160     GOSUB 8802:COLUMN=14:ROW=22:GOSUB 10:PRINT EOL$;
        PRINT "Please have patience ... Now loading your selection ";Y;
        ON Y GOTO 101,102,103,104,105,106,110

1000    REM READ #2,1;A2$,B2$,C2$,D2$,E2$,F2$,G2$,H2$,I2$,J2$
        REM PRINT #2,1;A2$,B2$,C2$,D2$,E2$,F2$,G2$,H2$,I2$,J2$
        CLOSE 2:GOTO 9990

1500    REM FILE I/O HERE
 
1503    READ #3,REC3;A3$
        RETURN

2000    PRINT CLEAR$:PRINT:PRINT:PRINT TAB(2);NAME$;TAB(70);DATE$
        PRINT TAB(2);LINE$;TAB(70);"REV ";REV$:PRINT:RETURN
  
2503    PRINT #3,REC3;A3$
        RETURN
 
2900    PRINT CLEAR$:VV=7:GOSUB 8
        PRINT TAB(20);"IT HAS NOW BEEN 6 MONTHS SINCE YOU HAVE RECEIVED"
        PRINT TAB(20);"YOUR PROGRAMS.":PRINT
        PRINT TAB(20);"WE HAVE BEEN CONSTANTLY IMPROVING & DEVELOPING"
        PRINT TAB(20);"NEW PROGRAMS, SO - - -":PRINT
        PRINT TAB(20);"PLEASE CALL US AT (916) 366-7840 FOR INFORMATION"
        PRINT TAB(20);"REGARDING OUR NEW DEVELOPMENTS & UPDATES"
        PRINT:PRINT:PRINT TAB(48);"Creative Data"
        PRINT:PRINT TAB(25);"PRESS RETURN ";:Y%=CONCHAR%
        J2$=P$:RETURN
 
3000    REM  ** INITIALIZE DEMO DISK IF PRESENT **
        RETURN

3040    REM DISK ROUTINE HERE
        PRINT CLEAR$:CONSTAB=20
        FOR X=1 TO 8:PRINT:NEXT X
        PRINT TAB(CONSTAB);"PLEASE HAVE PATIENCE. THIS MODULE IS NOT ";
        PRINT "IMPLEMENTED":PRINT TAB(CONSTAB);
        PRINT "YET. PLEASE CONTACT Creative Data FOR THE FUTURE DATE ";
        PRINT TAB(CONSTAB);"OF RELEASE. THANK-YOU":PRINT:PRINT
        PRINT TAB(CONSTAB);"PRESS 'RETURN' WHEN READY : ";:Y%=CONCHAR%
        PRINT CLEAR$:GOTO 150
 
4000    REM  ** ENTRY SCREEN **
        PRINT CLEAR$
        PRINT TAB(21);"***********************************"
        PRINT TAB(21);"*";TAB(55);"*"
        PRINT TAB(21);"*     NAME & ADDRESS PROGRAM      *"
        PRINT TAB(21);"*";TAB(55);"*"
        PRINT TAB(21);"***********************************"
        PRINT:PRINT:PRINT TAB(32);"VERSION ";REV$
        PRINT:PRINT:PRINT TAB(31);"Creative Data"
        PRINT TAB(30);"3208 MAGICWOODS"
        PRINT:PRINT TAB(28);"SACRAMENTO, CA 95827"
        PRINT:PRINT TAB(30);"(916) 366-7840"
        PRINT:PRINT TAB(30);"J.Butler (Pgmr)":PRINT
        PRINT TAB(30);"(PRESS RETURN) ";:Y%=CONCHAR%
        RETURN

6000    REM INPUT INFO
        Y$=""

6001    POKE DIO,0:CALL DIO+1
        CHR%=PEEK(DIO) AND 127
        IF CHR%=0 THEN 6001
        IF CHR%=8 AND LEN(Y$)<1 THEN 6001
        IF CHR%=27 THEN 9990
        IF CHR%=13 THEN RETURN
        IF CHR%=8  THEN Y$=LEFT$(Y$,LEN(Y$)-1):PRINT CHR$(8);" ";CHR$(8);
        IF CHR%<32 OR CHR%>122 THEN 6001
        PRINT CHR$(CHR%);:Y$=Y$+CHR$(CHR%):GOTO 6001

8802    ROW=ROW-1:GOSUB 10:PRINT EOS$:RETURN

8900    RETURN

9000    REM DIRECT CONSOLE I/O                               DB
        DATA 0,229,213,197,245,30,255,14,6,205,5,0,183,202,5,219,50,0
        DATA 219,241,193,209,225,201,0
        REM   DB 

9990    PRINT LOW$;CLEAR$:STOP
 
9992    FOR X=1 TO 24:PRINT:NEXT X
        PRINT TAB(20);"ACCESS NOT PERMITTED! SEE YOUR SYSTEM SUPERVISOR..";ERR;
        Y%=CONCHAR%
        IF Y%=5EH THEN 9990
        GOTO 9992
 

