!*************************** AMUS Program Label ******************************
! Filename: LANSET.BAS                                      Date: 05/06/96
! Category: UTIL         Hash Code: 000-000-000-000      Version: 1.0(100)
! Initials:   /AM        Name: Mike L. Sessi
! Company: Birmingham Data Systems Inc.            Telephone #: 707-795-1595
! Related Files: LANPRT.RUN
! Min. Op. Sys.: AMOSL 1.0                     Expertise Level: none
!*****************************************************************************
! 04/01/96 MIKE SESSI OF BIRMINGHAM DATA SYSTEMS
! LANSET UP PROGRAM WORKS WITH LANPRT
!
! I will scan for a maximum of twenty(22) extension
!
       MAP1 LANSET
               MAP2 LAN(22)
                       MAP3 EXT,S,3
                       MAP3 TRM,S,6
                                       ! where I copy (moveit) the file to
               MAP2 T'PPN,S,9                  ! [000,000]
               MAP2 FIL,S,305
!
       MAP1 EXT1,S,10
       MAP1 TRM1,S,10
       MAP1 FILE,S,10,"LANSET.UP"              ! Name of data file
       MAP1 SP,S,10,"          "
!
       STRSIZ 100
!
       PRINT TAB(-1,0)
       print "This is the setup program for 'LANPRT' and must be loaded"
       print "into a new and empty PPN. Any print file sent to this PPN"
       print "will automatically be copy to a interim PPN and then printed "
       print "on a specific printer base upon the file's extension"
       PRINT
       print "It was done this way so one file doesn't get printed"
       print "several times"
       print
       print "You must create two (2) PPN on the same disk."
       print "Run LANPRT from one and it will copy print-files to the other"
       print "and print them. Exp: [6,6] and [6,7]. Log into [6,6]"
       print "and first run LANSET. Then run LANPRT from a back ground job."
       PRINT "LANPRT will scan the directory block every 30 seconds."
       print "*Note: One could use MOVEIT instead of COPY "
       PRINT
       input "Is this where I am going to live ?",a$
       if ucs(a$)[1,1] # "Y" then  end
!
       LOOKUP FILE,FOUND
       IF FOUND=0 THEN ALLOCATE FILE,1
       OPEN #100,FILE,RANDOM,512,F1
       F1=0
       IF FOUND=0 THEN WRITE #100,SPACE(512)
       READ #100,LANSET
       print tab(-1,0)
       print tab(1,8); "  File           Printer     Interim"
       print tab(2,8); "Extension         Name         PPN"
       print tab(3,8); "-----------------------------------"
       PRINT TAB(23,12); "^ In this row, type END to update/exit ";
       PT=0
       FOR A=4 TO 22
               PT=PT+1
               PRINT TAB(A,09); STR(PT);" ";EXT(PT); TAB(A,25); TRM(PT);
       NEXT A
       print tab(4,40); T'PPN;
       IF T'PPN[1,1] # "[" THEN PRINT TAB(4,40); "[000,000]"
       PRINT TAB(4,40);
       a$=chr(0)
       INPUT LINE "",a$
       if asc(a$) # 0 then T'PPN=a$
       PT=0
       FOR A=4 TO 22
               PT=PT+1
!
! What extension(s) will I be scaning for ?
!
EXT:            EXT1=CHR(0)
               PRINT TAB(A,11);
               INPUT "",EXT1
               IF UCS(EXT1)= "END" THEN A=22 : GOTO NT         ! UPDATE/EXIT
               IF ASC(EXT1)=0 THEN GOTO TRM
               IF LEN(EXT1) > 3 THEN CALL ERR'LONG : PRINT TAB(A,11); SP : &
                       GOTO EXT
               EXT(PT)=EXT1
!
! Which printer is this file going to?
!
TRM:            TRM1=CHR(0)
               PRINT TAB(A,25);
               INPUT "",TRM1
               IF ASC(TRM1)=0 THEN GOTO NT
               IF LEN(TRM1) > 6 THEN CALL ERR'LONG : PRINT TAB(A,25); SP : &
                       GOTO TRM
               TRM(PT)=TRM1
NT:     NEXT A
       WRITE #100,LANSET
       END
ERR'LONG:
       PRINT TAB(23,1); "TOO LONG.  RETURN TO RECOVER";CHR(7);
       INPUT "",A$
       PRINT TAB(23,1); TAB(-1,9);
       RETURN