/*
   Title: CD-ROM Manager 2.0
    Type: BBS CLI/StdIO Door
      By: Vis Naidu
     NET: NAIDUVV@MEENA.CC.UREGINA.CA
    Date: May 28.96
*/

OPTIONS RESULTS

a=0
say ' '
say ''
say 'Loading [ PATH NAMES ]...'
call open('vis','doors:cdrom/nightowl12/dirs.txt','R')
do while ~eof('vis')
   a=a+1
   filepath.a=readln('vis')
end
call close('vis')
a=0
say ' '
say 'Loading [ DIRECTORY NAMES ]...'
call open('siv','doors:cdrom/nightowl12/desc.txt','R')
do while ~eof('siv')
   a=a+1
   dirname.a=readln('siv')
end
call close('siv')
libnum=a-1
a=1

Menu:
   say ' '
   say ''
   say ' '
   say '                                                 [CD]: Night Owl PC CD-ROM 12'
   say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ'
   say '( L ) List Files in This Area          ( D ) Download File from This Area'
   say '( I ) Information on a File            ( C ) Change to a different Area'
   say '( V ) View Contents of an Archive      ( Q ) Quit to BBS'
   say '( A ) About This Program'
   say 'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
   say ' '
   say 'Lib #: 'a' ... 'dirname.a
   say ' '
   options prompt '< RETURN=Quit, Enter CHOICE >: '
   pull choice
   choice=upper(choice)
   if choice = ''  then call Done
   if choice = 'L' then call LstFiles
   if choice = 'I' then call InfoFl
   if choice = 'V' then call ViewArc
   if choice = 'D' then call DlFile
   if choice = 'C' then call ChgArea
   if choice = 'A' then call About
   if choice = 'Q' then call Done
   call Menu
end

LstFiles:
   say ' '
   say 'One Moment...'
   address command 'copy 'filepath.a'files.bbs ram:flist'
   datafile='ram:flist'
   say ' '
   say ''
   call open('reader',datafile,'R')
   yes=1
   b=2
   numlist=0
   do while yes=1
      if b >= 23 then do
         b=0
         say ' '
         options prompt '[RETURN] to Continue, [Q] to Quit, [D] to Download File: '
         pull dude
         dude=upper(dude)
         if dude = 'Q' then do
            call close('reader')
            call Menu
         end
         if dude = 'D' then do
            call close('reader')
            call DLFile
            call Menu
         end
         say ' '
      end
      if eof('reader') then yes=0
      if ~eof('reader') then do
         dat=readln('reader')
         say dat
      end
      b=b+1
   end
   call close('reader')
   options prompt '[RETURN] to Continue, [D] to Download File: '
   pull dudley
   dudley=upper(dudley)
   if dudley='D' then call DlFile
   yes=1
Return

InfoFl:
   say ' '
   options prompt 'View Long Description for which File: '
   pull flinfo
   flinfo=upper(flinfo)
   if flinfo='RESULT' then call Menu
   if flinfo='' then call Menu
   say ' '
   say 'Please Wait...'
   if ~exists(filepath.a||flinfo) then do
       say ' '
       say 'File does not exist...'
       say ' '
       options prompt 'Press [RETURN] to Continue: '
       pull cont
   end
   if exists(filepath.a||flinfo) then do
      if exists(filepath.a||flinfo||'.readme') then do
         say ' '
         newlist=filepath.a||flinfo||'.readme'
         say ''
         say 'Retreiving Long Description for: 'flinfo'... Please Wait...'
         say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
         address command 'rx rexx:CDType.Rexx 'newlist
         say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
         options prompt 'Press [RETURN] to Continue: '
         pull cont
         call Menu
      end
      newlen=length(flinfo)-3
      newfl=substr(flinfo,1,newlen)
      if exists(filepath.a||newfl||'readme') then do
         say ' '
         newlist=filepath.a||newfl||'readme'
         say ''
         say 'Retreiving Long Description for: 'flinfo'... Please Wait...'
         say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
         address command 'rx rexx:CDType.Rexx 'newlist
         say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
         options prompt 'Press [RETURN] to Continue: '
         pull cont
         call Menu
      end
      newline
      say 'There exists no Long Description...'
      say ' '
      options prompt 'Press [RETURN] to Continue: '
      pull cont
   end
Return

ViewArc:
   say ' '
   say ''
   say 'Archive formats supported ->'
   say ' '
   say '.LZH .LHA .ZIP .ZOO .ARC .SIT .ARJ .DMS .TAR .GZ .Z'
   say ' '
   options prompt 'Enter Filename to View [Max. 25 Chars]: '
   pull flname
   flname=upper(flname)
   if flname='' then call Menu
   if flname='RESULT' then call Menu
   say ' '
   say 'Please Wait...'
   if ~exists(filepath.a||flname) then do
      say ' '
      say 'File does not exist...'
      say ' '
      options prompt 'Press [RETURN] to Continue: '
      pull cont
   end
   if exists(filepath.a||flname) then do
      arc.1 = '.LHA';arccmd.1 = 'LHA v'
      arc.2 = '.LZH';arccmd.2 = 'LHA v'
      arc.3 = '.ZIP';arccmd.3 = 'UNZIP -v'
      arc.4 = '.ZOO';arccmd.4 = 'ZOO v'
      arc.5 = '.ARC';arccmd.5 = 'ARC v'
      arc.6 = '.ARJ';arccmd.6 = 'UNARJ v'
      arc.7 = '.SIT';arccmd.7 = 'UNSIT v'
      arc.8 = '.DMS';arccmd.8 = 'DMS View'
      arc.9 = '.TAR';arccmd.9 = 'TAR -v'
      arc.10 = '.GZ';arccmd.10 = 'GZIP -l'
      arc.11 = '.Z';arccmd.11 = 'GZIP -l'
      c=0
      do while c<12
         c=c+1
         if index(flname,arc.c) > 0 then do
            say ' '
            say 'One Moment, Reading File Contents...'
            address command arccmd.c' 'filepath.a||flname' >ram:vlist'
            say ' '
            say 'Contents of File: 'flname
            say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
            say ' '
            address command 'rx rexx:CDType.Rexx ram:vlist'
            say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
            say ' '
            options prompt 'Press [RETURN] to Continue: '
            pull cont
            call Menu
         end
      end
      say ' '
      say 'File chosen is NOT an Archive...'
      say ' '
      options prompt 'Press [RETURN] to Continue: '
      say ' '
   end
Return

DLFile:
   say ' '
   options prompt 'Enter filename to Download [Max. 25 Chars]: '
   pull filedl
   filedl=upper(filedl)
   if filedl='RESULT' then call Menu
   say ' '
   say 'Please Wait...'
   if ~exists(filepath.a||filedl) then do
      say ' '
      say 'File does not exist...'
      say ' '
      options prompt 'Press [RETURN] to Continue: '
      pull cont
   end
   if exists(filepath.a||filedl) then do
      say ' '
      say ''
      say ' '
      say ' Transfer Protocols:'
      say 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'
      say '³ 1 - XModem         ³'
      say '³ 2 - XModem CRC     ³'
      say '³ 3 - XModem 1K      ³'
      say '³ 4 - YModem [Batch] ³'
      say '³ 5 - YModem-G       ³'
      say '³ 6 - ZModem         ³'
      say 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'
      say ' '
      options prompt '< RETURN=Abort, Enter CHOICE >: '
      pull prot
      if prot = '' then call Menu
      if prot = '1' then do
         say 'Sending Filename: 'filedl', using X-Modem CheckSum...'
         say ' '
         address command 'doors:xprd/xprd -lxprxmodem.library -oT0,C0,K0 -dnullmodem.device -u0 -s send 'filepath.a''filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
      if prot = '2' then do
         say 'Sending Filename: 'filedl', using X-Modem CRC...'
         say ' '
         address command 'doors:xprd/xprd -lxprxmodem.library -oT0,C1,K0 -dnullmodem.device -u0 -s send 'filepath.a''filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
      if prot = '3' then do
         say 'Sending Filename: 'filedl', using X-Modem 1K...'
         say ' '
         address command 'doors:xprd/xprd -lxprxmodem.library -oT0,C1,K1 -dnullmodem.device -u0 -s send 'filepath.a''filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
      if prot = '4' then do
         say 'Sending Filename: 'filedl', using Y-Modem [Batch]...'
         say ' '
         address command 'cd 'filepath.a
         address command 'doors:xprd/xprd -lxprymodem.library -oZ0,B1,C1 -dnullmodem.device -u0 -s send 'filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
      if prot = '5' then do
         say 'Sending Filename: 'filedl', using Y-Modem G...'
         say ' '
         address command 'cd 'filepath.a
         address command 'doors:xprd/xprd -lxprgmodem.library -oB1,C1,YG,Z -dnullmodem.device -u0 -s send 'filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
      if prot = '6' then do
         say 'Sending Filename: 'filedl', using Z-Modem...'
         say ' '
         address command 'doors:xprd/xprd -lxprzmodem.library -dnullmodem.device -u0 -s send 'filepath.a''filedl' >ram:dlist'
         address command 'run <nil: >nil: delete ram:dlist'
         say ' '
         options prompt 'Press [RETURN] to Continue: '
         pull cont
      end
   end
Return

ChgArea:
   say ' '
   say ''
   address command 'rx rexx:CDType.Rexx doors:cdrom/nightowl12/libmenu'
   say ' '
   options prompt 'Select Library # [1-'LibNum']: '
   pull newlib
   if newlib='RESULT' then do
      newlib=1
   end
   if newlib < 1 | newlib > libnum then call Menu
   if newlib >=1 & newlib <= libnum then do
      A=newlib
   end
Return

About:
   say ' '
   say ''
   say 'About This Program...'
   say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
   say 'Author : Vis Naidu'
   say '         Running M A X''s BBS 1.54 [PD]'
   say 'BBS    : The TeKKnoZone'
   say 'Tel. # : (306) 586-2111'
   say 'Baud   : 300-14400 bps'
   say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
   say 'Door   : CD-ROM Manager 2.0'
   say '         CD-ROM Utility to Access CDs Online'
   say '         Release : May 28, 1996'
   say 'Ä ÄÄ ÄÄÄ ÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄ Ä'
   say ' '
   options prompt 'Press [RETURN] to Continue: '
   pull cont
Return

Done:
exit 0

/* End of CD-ROM Manager 2.0 */

