/*************************************************/
/*                                               */
/*  MegaCDDOOR.rexx v1.3 © David Huckett..       */
/*         Xenolink  CD-Rom Door.                */
/*   By David Huckett  22-Sep-95 3:640/800 Fido  */
/*************************************************/

/* NOTES
 * 31-July-95 Added bit to allow just to show online CDs only..
 * 12-Aug-95  Removed Listcreator function from within door
 * 12-Sep-95  added option to allow users with no credit to
 *            to be able to have a look around..
 *            Suggested by Peter Chalmers
 *            Added a new file called entry.txt, if found by MegaCd
 *            during startup, it will display the file to the user..
 *
 * 22-Sep-95  Search function working OK now, so I will release for users
 *            to test out..
 *            OFFLINE Requests now implemented and working.. Use the function
 *            and send reports in to me on any ideas on the function...
 *            This is a grey area as far as I have not seen it in use on any
 *            other system, but so far here it works fine..
*/


/**  GLOBALS TO CONFIGURE TO YOUR SYSTEM REQUIREMENTS **/

ENFORCERATIOS  = 'N' 
MAXMARKED      = '10'
PATH           = 'Doors:MegaCD/'
CDCFG          =  PATH'CD.cfg'
LINESPERPAGE   = '24'        /** Watch this one as it may stuff up display **/
BYTECHECK      = 'Y'         /** Read Docs and History for a description of this **/

ONLINEONLY = 'n'  /* new for two reasons.. 1 for those who only want to */
                  /* display online CDs' 2 Cause I am working over a network */
                  /* now and I had problems with having CDs' in drives on the */
                  /* Network and being able to lock on them wherever they are */
                  /* Loaded */
	/* IF YOU DO NOT run over a network       or want to display all */
	/* configured CD's on or offline, then make ONLINEONLY = 'N'..   */
	/* But remember to remove the second NET: entry for any CDs' in  */
	/* the main CD.cfg file..  Make new .cfg files for each CD over net  */
 

/**************** NO FURTHER USER DEFINES BELOW ****************/
 
options results
VERS = 'MegaCDDoor v1.3'
SysopLog 'Entered Door: MegaCD'
PR = 'PRINT'
minbyte = 200000            /** Minumum amount of memory that needs **/
                            /** to be free at all times during use  **/
if storage() < minbyte then do
   pr 'Not enough memory to run MegaCD safely!'
   GetChar
   signal QUIT
end

arg Node tmrem baud cps
host = 'XenolinkRexxPort'Node
address value host
signal on error
signal on syntax
signal on ioerr

 if ~show('L','rexxsupport.library') then do
  if ~addlib('rexxsupport.library',0,-30,0) then do
    PR 'Support library not available.'
     call error
    signal Quit
   end
end

	if exists('T:MRXDL'node'.sfl') then do
		Address Command 'Delete T:MRXDL'node'.sfl QUIET'
END
getuservar name ; name = result
getuservar privilege ; access = result
getuservar maxbytesperday ; mbytday = result 
getuservar bytesdownloadedtoday ; bytdowntoday = result
getuservar fileratio ; fileratio = result
getuservar uploads   ; uploads   = result
getuservar downloads ; downloads = result
getuservar byteratio ; byteratio = result
getuservar uploadbytes ;   uploadbytes  = result
getuservar downloadbytes ; downloadbytes = result
getuservar filesdownloadedtoday ; filesdownloadedtoday = result
fullname = SPACE(name,1,_)

BytesAllowed = Mbytday - Bytdowntoday
Numselect = '0'
Numremain = '20'
btselect  = '0'

SETNODESTATUS "MegaCD."

/** For new users who havent uploaded or downloaded yet **/
If Downloads = 0 & Uploads = 0 Then do
Uploads = 1
uploadbytes = 500000
end

	If FileRatio = 0 Then do
		ActFileRatio = 'Unlim'
	end
	else ActfileRatio = FileRatio

	If ByteRatio = 0 Then do
		ActByteRatio = 'Unlim'
	End
	Else ActByteRatio = ByteRatio

If EnforceRatios = 'Y' Then do
   If FileRatio ~= 0 Then do
      NumRemain = (Uploads * FileRatio) - Downloads
        If Numremain < 1 Then NumRemain = 0
   End

   IF ByteRatio ~= 0 Then do 
      BytesAllowednow = (UploadBytes * ByteRatio) - DownloadBytes
      If BytesAllowednow < 1 Then BytesAllowednow = 0
      If bytesAllowednow < BytesAllowed Then BytesAllowed = BytesAllowednow
   End
   If NumRemain <1 | BytesAllowed <1 Then Call Ratio
End
IF MaxMarked > Numremain Then MaxMarked = NumRemain

GETUSERVAR MENUSET 
gfx=result         
if gfx >='1' then do
	WHI='[1;37m';RED='[31m';GRN='[32m';BGRN='[1;32m';YEL='[33m'
        BYEL='[1;33m';BLU='[34m';MAJ='[35m';CYA='[36m';BCYA='[1;36m'
	OFF='[0m'
END
	ELSE DO
	WHI='';RED='';GRN='';BGRN='';YEL='';BYEL='';BLU='';MAJ='';CYA=''
	OFF='';BCYA=''
END

p='###PANIC';cmd = '';FILE = ''

CALL PRAGMA('W','N')  /* Disk Requesters OFF */
tmrem = tmrem*60;CALL TIME('R')

	if exists(PATH'Entry.txt') then do
        CLS
        DISPLAYFILE PATH'Entry.txt'
end


START:
CLS
pr BLU'          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿'
pr BLU'          ³'BGRN'                MegaCD  CD-Rom Door'OFF||BLU'                ³'
pr BLU'          ³                                                   ³'
pr BLU'          ³'BCYA'    for Xenolink BBS, by David Huckett (c)1995'OFF||BLU'     ³'
pr BLU'          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ'
pr

	if ~exists(CDcfg) then do
	PR ' You do not have a config file!'
	call ERROR
end
	else do
	Call open(cfg,CDcfg,'R')
		numcd=readln(cfg)
		do i=1 to numcd
	lock.i=readln(cfg)
	title.i=readln(cfg)
        name.i = title.i
	config.i=readln(cfg)
	desc.i=readln(cfg)
	noacclevel.i=readln(cfg)
	noviewlev.i=readln(cfg)

if index(noacclevel.i,access) ~=0 then existnoacc.i = 'No Access'
existnoview = index(noviewlev.i,access)  /* See if you have given access to their level */
if existnoview ~= 0 then do  /* Check to see if the user has view access */
title.i = 'No View'          /* eg GIF CD's, if not then flag this one out */ 
iterate i
end

if  ~Exists(lock.i) then do
	if onlineonly = 'Y' then iterate i
pr YEL||left(i'.',4)CYA||left(title.i,15)RED||left('OFFLINE',8)OFF||left(desc.i,45)
title.i='Not Online'        /* If the system can't get a lock on the volume */
iterate i                   /* then flag it offline */
end
pr YEL||left(i'.',4)CYA||left(title.i,15)BGRN||left('Online',8)OFF||left(desc.i,45)
   end
		call close(cfg)
end


MAIN:

Call seiko

pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'Q'WHI'-'YEL'D'WHI'-'YEL'K'WHI'-'YEL'?'WHI'-'YEL'F'WHI'-'YEL'R'WHI'-'YEL'Select #'WHI') 'OFF'>'
pr
prompt 20 normal pstring
cmd=strip(upper(result))
Search = 'N'
Request = 'N'
if cmd=' ' then signal main
if cmd='F' then do                  /*Find/search.....*/
pr
prompt 4 normal YEL'Enter Online CD to search. '
cmd=strip(upper(result))
Search = 'Y'
end

if cmd='R' then do                 /*Offline Request...*/
pr
prompt 4 normal YEL'Enter OFFLINE CD for request..'
cmd= strip(upper(result))
if cmd = '' then signal start
Request = 'Y'
end

if value(cmd)<=numcd then do
	if title.cmd = 'No View' then do
		pr
		pr RED'       Sorry you cannot view that volume..'OFF
		call delay 100
		signal start
	end
	if existnoacc.cmd = 'No Access' then do
		pr
		pr RED'       Sorry you do not have access to that volume. 'OFF'('GRN'Contibuting Members only'OFF')..'
		call delay 100
		signal start
	end

	if title.cmd = 'Not Online' then do
			if Request = 'Y' then call Requested(SPACE(name.cmd,1,'_'),config.cmd)
			pr
			pr RED'       Sorry that volume is not currently loaded..'OFF
			pr
			pr CYA'  You may wish to use the offline request utility by'OFF
			pr CYA' hitting R at the main prompt..'OFF 
			call delay 150
			signal start
			end
		else do
                if search = 'Y' then call SearchCD(SPACE(Title.cmd,1,'_'),config.cmd)
		else call Selected(cmd)
	end
end
if cmd="###PANIC" then call Quit
if cmd='D' then signal Download
if cmd='K' then do
		if exists('T:MRXDL'node'.sfl') then do
			Address Command 'Delete T:MRXDL'node'.sfl QUIET'
			pr
			pr GRN'Marked files now deleted....'OFF
			numselect = 0
			signal main
			end
		else do
			pr
			pr GRN' You have not got any files marked yet!'OFF
			signal main
			end
	end
if cmd='HELP' | cmd='?' then signal Help1
if left(cmd,1)='Q' then signal quit

pr 'Unkown Command 'cmd
signal main


SELECTED:
PARSE ARG cmd
CLS
pr
pr BGRN||Center('Directories available on 'title.cmd' CD-Rom', 80)||OFF
pr

SETNODESTATUS "Listing files on "title.cmd

if ~exists(config.cmd) then do
pr ' config file: 'config.cmd 'not found. Please notify sysop.'
call delay 100
signal start
end

call open(cdcfg,config.cmd, 'R')
cdpath      = readln(cdcfg)
indexpath   = readln(cdcfg)
displayfile = readln(cdcfg)
skipstart   = readln(cdcfg)
tot = 0
twin = 0
do j = 1 while ~EOF(cdcfg)
dirs.j    = readln(cdcfg)
if dirs.j = '' then iterate j
twin = twin+1
tot = tot+1
tnum = Left(j'.',4)
	IF twin=1 then msg YEL||tnum||CYA||left(subword(dirs.j,2), 30)||OFF
	IF twin=2 Then do
		pr YEL||tnum||CYA||left(subword(dirs.j,2), 30)||OFF
		twin = 0
end

        IF (j/2+4)//linesperpage=0 THEN  /**added 3-6-95 for better display of dirs ***/
        DO
	pr
	Prompt 3 Normal WHI'More? 'GRN'Y'WHI'/'YEL'n'OFF' >'
	wnow = strip(upper(Result))
	if wnow = 'N' then do
	call close(cdcfg)
	signal Seldir
	end 
        END
end
call close(cdcfg)
Signal Seldir


SELDIR:
call seiko
pr
pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'D'WHI'-'YEL'A'WHI'-'YEL'K'WHI'-'YEL'C'WHI'-'YEL'Q'WHI'-'YEL'?'WHI'-'YEL'Select #'WHI') 'OFF'>'
PROMPT 5 NORMAL pstring
answer = strip(Upper(result))
if answer = '' | if answer = 'A' then signal selected(cmd)
if answer = 'D' then signal Download
if left(answer,1) = 'Q' then Signal Quit
if answer = 'C' then signal start
if value(answer) <= tot then do;File = CDPATH||Word(dirs.answer,1)||displayfile;Lists = INDEXPATH||Word(dirs.answer,1)||displayfile;pr;pr MAJ'Loading filelist...'OFF;call printindex(File,Lists);end
if answer = '?' | answer = 'HELP' then signal Help2
if value(answer) > tot then do;pr;pr RED'No such number listed! Try again..'OFF;signal Seldir;End
if answer='K' then do
		if exists('T:MRXDL'node'.sfl') then do
			Address Command 'Delete T:MRXDL'node'.sfl QUIET'
			pr
			pr GRN'Marked files now deleted....'OFF
			numselect = 0
			signal Seldir
			end
		else do
			pr
			pr GRN' You have not got any files marked yet!'OFF
			signal Seldir
			end
		end
pr 'Unkown Command 'answer
signal start


SEARCHCD:
PARSE ARG CDtitle,configCD
if exists(PATH'Search.rexx') then address command 'rx 'PATH'Search.rexx 'Node CDtitle ConfigCD
else do
	pr 'Cant find Search.rexx in MegaCD directory'
        pr 'Or the sysop has not set up the search function.'
	call delay 100
	end			
		signal start

REQUESTED:
PARSE ARG CDtitle,configCD
if exists(PATH'MegaReq.rexx') then address command 'rx 'PATH'MegaReq.rexx 'Node CDtitle ConfigCD

else do
	pr 'Cant find MegaReq.rexx in MegaCD directory'
        pr 'Or the sysop has not set up the Offline Request function.'
	call delay 100
	end			
		signal start

PRINTINDEX:
PARSE ARG FILE,LISTS
If ~Exists(LISTS) then do
	PR ' Index file not found.. Notify Sysop.'
	Call delay 100 
	signal start
end
	else do
Call Open(disp,LISTS, 'R')
f = 1
do h = 1 to skipstart
junk.h = readln(disp)
end
CLS
do k =1 While ~EOF(disp)
fl.k = Readln(disp)
if word(fl.k,1) == D2C('26') then Iterate k
if word(fl.k,1) == '|'then do
	if k < 1 then Iterate k
	else do
	pr left(Fl.k,73)
	k = K-1
	f = f+1      /**added 3-6-95 for better display of files ***/
      IF f//linesperpage=0 THEN DO
Call markprompt(FILE)
        END
	iterate k
	end
end
else do
if substr(fl.k,1,1) == ' ' then do
	if k < 1 then Iterate k
	else do
	pr left('',15)left(Fl.k,71)
	k = K-1
	f = f+1     /**added 3-6-95 for better display of files ***/
      IF f//linesperpage=0 THEN
        DO
Call markprompt(FILE)
        END
	iterate k
	end
end
end
if substr(fl.k,1) ~= ' ' then do
fnum = left(k'.',4)
pr YEL||fnum||CYA||Left(Word(Fl.k,1),24)||OFF||subword(left(Fl.k,71),2) /* 73*/
f = f + 1          /**added 3-6-95 for better display of files ***/
      IF f//linesperpage=0 THEN
        DO
Call MarkPrompt(FILE)
        END
end
end
call close(disp)
pr 'Directory end.'
call markprompt(FILE)
Call Selected(cmd)



MARKPROMPT:
PARSE ARG FILE
call seiko
pstring = WHI'['GRN||numselect||WHI']'showtime()||WHI' ('YEL'D'WHI'-'YEL'K'WHI'-'YEL'M'WHI'-'YEL'C'WHI'-'YEL'S'WHI'-'YEL'Q'WHI'-'YEL'?'WHI'-'YEL'A'WHI'-'YEL'[return]'WHI') 'OFF'>'
Prompt 3 Normal pstring
	hnow = strip(upper(Result))
	if hnow = 'M' then do
			Call Markfile;return;end
	if hnow = 'C' then do
			call close(disp);Call Selected(cmd);end
	if hnow = 'S' then do
			call close(disp);signal Start;end
	if hnow = 'Q' then do
			call close(disp);signal QUIT;end
	if hnow = 'D' then do
			call close(disp);signal Download;end
	if hnow = '?' then do
			call close(disp);call HELP3(FILE,LISTS);end
        if hnow = 'A' then do
			call close(disp);CALL PrintIndex(FILE,LISTS);end
	if hnow = 'K' then do
		if exists('T:MRXDL'node'.sfl') then do
			Address Command 'Delete T:MRXDL'node'.sfl QUIET'
			pr
			pr GRN'Marked files now deleted....'OFF
			numselect = 0
			signal markprompt
			end
		else do
			pr
			pr GRN' You have not got any files marked yet!'OFF
			signal markprompt
			end
		end
RETURN


MARKFILE:
pr
Prompt 4 Normal '['GRN||numselect||OFF']'WHI'Filenumber #? ('YEL'D'WHI')-('YEL'C'WHI')ontinue.> '
Filenum = Strip(Upper(result))
if Filenum = '' | Filenum = 'C' then return
if Filenum = 'D' then signal Download
if datatype(filenum,'NUMERIC') = 0 then do
pr 'You must use a number to select files..'
call delay 50
signal markfile
end
if value(filenum) <= k then do
markedfile = FL.filenum
		If numselect >= Maxmarked then do
		pr
		pr RED' Maximum files ('maxmarked') already marked!'OFF
		call delay 50
		return
		end
/************************** new stuff to get file size ****************/
tofile = CDPATH||Word(dirs.answer,1)||Word(markedfile,1)

/** disable if trouble found **/
if Bytecheck = 'Y' then do
			fsze = word(Statef(tofile),2)
			bytesallowed = bytesallowed - fsze
			If bytesallowed < 1 then do
			pr
			pr RED' You have exceeded your available download bytes'
			call delay 50
			return
			end
		end

filepaths = CDPATH||Word(dirs.answer,1)
numselect = numselect + 1

if Bytecheck = 'Y' then pr left('   File #'numselect' marked: 'YEL||word(markedfile,1)||OFF,55)'Bytes: 'YEL||fsze||OFF
else pr left('   File #'numselect' marked: 'YEL||word(markedfile,1)||OFF,55)

if ~exists('T:MRXDL'node'.sfl') Then do
	call open(tempdl,'T:MRXDL'node'.sfl','W')
	Call WriteLn(Tempdl,filepaths word(MarkedFile,1))
	Call Close(Tempdl)
end
else do
	Call open(Tempdl,'T:MRXDL'node'.sfl','A')
	Call WriteLN(tempdl,filepaths word(MarkedFile,1))
	Call Close(tempdl)
end

end
signal Markfile


DOWNLOAD:
if ~exists('T:MRXDL'node'.sfl') Then do
pr
pr ' You have no files marked for download !'
call delay 100
signal Start
end
else do
pr 'If you elect to continue, your selected files will be added to'
pr 'the normal BBS download list..'
pr
pr 'To collect your files use the 'BYEL'MegaRXDL DOWNLOAD'OFF' command in the file Menu.'
pr
pr 'If you wish to remain within the CD-Rom door to mark further files'
pr 'for downloading before leaving, hit (A)bort now and you will be returned'
pr 'to the CD-Rom selection menu.'
pr
Call Listfiles

DOWNLOAD1:
prompt 4 Normal WHI'['YEL'return'WHI'] to continue ('YEL'L'WHI')ist ('YEL'A'WHI')bort.'OFF' >'
whatnext = strip(upper(result))
if whatnext = 'A' then signal start
if whatnext = 'L' then signal Listfiles


SysopLog 'Exited MCDDoor (return code 0)'

exit 0




QUIT:

if exists('T:MRXDL'node'.sfl') then do
pr
pr YEL'Your marked files will be lost if you continue..'
prompt 3 Normal WHI'('YEL'C'WHI')ontinue ('YEL'D'WHI')ownload 'OFF'>'
leave = strip(upper(result))
if leave = 'D' then signal download
Address Command 'Delete T:MRXDL'node'.sfl QUIET'
END
SysopLog 'Exited MCDDoor (return code 0)'

exit 0


/***************** Ratio enforcer on login ****/
RATIO:
CLS
pr
Pr 'It seems you have exceeded your File/Byte Ratio or your daily available'
Pr 'download byte limit.. '
Pr 'Further download credits can be obtained by uploading some files..'
Pr
Pr 'Upon validation of new uploads, files found to be rubbish uploads'
pr 'will result in the removal of download credits.'
pr
pr 'Further info or help may be obtained by contacting the Sysop.'
pr
msg 'Do you still wish to browse available files ? Y/n '
getchar
reply = upper(result)
if reply = 'N' then signal quit
else return



/***************** List marked files *********/
LISTFILES:
totbyt = '0'
pr
pr CYA' The following files are marked for Download..'OFF
pr
call open(lst,'T:MRXDL'node'.sfl','R')
do g=1 to numselect 
markf.g = Readln(lst)

tofile = Word(markf.g,1)||Word(markf.g,2)

if ByteCheck = 'Y' then do
		fsze = word(Statef(tofile),2)
		pr GRN||left('    File #:'BYEL||g CYA||word(markf.g,2)||OFF,55) 'Bytes: 'BYEL||fsze||OFF
		totbyt = totbyt + value(fsze)
		end
else do
	pr GRN||left('    File #:'BYEL||g CYA||word(markf.g,2)||OFF,55)
	end
end

if ByteCheck = 'Y' then do
	pr
	pr '      Total bytes:'BCYA||totbyt||OFF
	if cps ~='N/A' then timedown = Trunc((totbyt / cps) /60,2)
end
	else timedown = 'n/a'

if baud ~= 'LOCAL' then do
	pr '      Estimated Download Time @ 'BYEL||baud||OFF' baud: 'BYEL||timedown||OFF' mins.'
	pr
	end
else do
pr ' I find it a little hard to estimate how long'
pr ' you take to download a file while logged in 'BCYA||baud||OFF
pr
end
Call close(lst)
signal Download1

/***************** Display time remaining ****/
showtime:
mins=(tmrem-TIME('E'))%60
secs=TRUNC((tmrem-TIME('E'))//60)
IF secs<10 THEN secs='0'secs
RETURN RED'Time left: 'GRN||mins':'secs

/***************** Timer check ***************/
SEIKO:
test=TIME('E')
  IF test>(tmrem-240) then do
      If test>(tmrem-120) then do
          pr;pr  BYEL'*** This session''s time is expiring! ***'OFF
        Call delay 100
	Call QUIT 
        End
      Else pr BYEL'*** Less than 2 minutes remaining in door! ***'OFF
call delay 100
End
Return

/*************** HELP1 from Main prompt **********/
HELP1:

pr
pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
pr 'to enable the Mark Prompt, then enter the number of the file you want'
pr
pr 'Enter the 'BYEL'number'OFF' displayed in front of the volume you wish'
pr 'to access to move you into the main directories of that volume.'
pr
pr 'If you enter a number of a volume that is 'BYEL'not displayed'OFF' on the menu'
pr 'you will be told that you do not have view access to that volume, or'
pr 'if there is not a volume configured for the entered number, you will'
pr 'be presented with the main prompt again.'
pr 'The number in front of the actual prompt eg. ['GRN'0'OFF'] is the number of'
pr 'files you have presently marked for download.'
pr
pr 'NEW COMMANDS:'
pr ' R is used to make a request for a file on an offline CD'
pr 'The prompts will ask the questions, then if the CD containing the file you'
pr 'want has been loaded before your next call, you will be told the file is'
pr 'ready and you may then download it..'
pr ' S is used to do a search for a particular file on a CD.. It is a basic'
pr 'search function that does the job, but is no super speed command,'
pr 'especially searching 3000+ files in an Arexx program.. Try it out..'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
pr
pr
pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from most prompts will give you help for the section of the'
pr 'CD-Rom doorway you are in at that prompt.'
pr
pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
pr 'files for download.'
pr
pr BYEL'K 'OFF' ill all files presently marked so you can mark a different selection.'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
Signal Start

/*************** Help2 for Seldir Prompt *********/
HELP2:
pr
pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
pr 'to enable the Mark Prompt, then enter the number of the file you want'
pr
pr 'Enter the 'BYEL'number'OFF' displayed in front of the directory you wish'
pr 'to view contents.'
pr
pr 'If you enter a number of a directory that is 'BYEL'not displayed'OFF
pr 'you will be told no such directory exists and you will be presented'
pr 'with the prompt again.  You cannot enter a directory that has not'
pr 'scrolled onto the screen since loading the actual filelist...'
pr
pr 'The number in front of the actual prompt eg. ['GRN'0'OFF'] is the number of'
pr 'files you have presently marked for download.'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
pr
pr
pr BYEL'D'WHI' ownload'OFF' will commence the download procedure and place you'
pr 'back at the menu you started MegaCD from, where you can use the'
pr 'normal system Download command to recieve your marked files..'
pr
pr BYEL'C'WHI' d'OFF' will put back at the main screen for you to select a'
pr 'different CD-Rom volume.'
pr
pr BYEL'A'WHI' gain'OFF' will redisplay the list of directories available.'
pr
pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from most prompts will give you help for the section of the'
pr 'CD-Rom doorway you are in at that prompt.'
pr
pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
pr 'files for download.'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
call Selected(cmd)

/*************** Help3 for MarkPrompt Prompt *********/
HELP3:
parse arg FILE,LISTS
pr
pr 'This program uses MARK BY NUMBER.. If you want to mark files, hit M'
pr 'to enable the Mark Prompt, then enter the number of the file you want'
pr
pr BYEL'M'WHI' ark'OFF' files for download..  You may mark up to 'MAXMARKED' files'
pr 'before you are told maximum reached, then you will have to'
pr 'download all marked files, before you select any more.'
pr
pr 'If you enter a number of a file that is 'BYEL'not displayed'OFF
pr 'or has not come into view since the list was loaded, you will be'
pr 'presented with the prompt again.'
pr
pr BYEL'S'WHI' elect'OFF' will put you back to select a different volume.'
pr
pr 'The number in front of the actual prompt while marking files eg.'
pr '['GRN'0'OFF'] is the number of files you have presently marked.'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
pr
pr
pr BYEL'C'WHI' d'OFF' will put back at the main screen for you to select a'
pr 'different directory in the current CD-Rom volume.'
pr
pr BYEL'A'WHI' gain'OFF' will redisplay the list of files in the current directory.'
pr
pr BYEL'? 'OFF'or 'BYEL'HELP'OFF' from any prompt will give you help for the section of the'
pr 'CD-Rom doorway you are in at that prompt.'
pr
pr BYEL'Q 'OFF'or 'BYEL'Quit'OFF' will exit from the door without saving your selected'
pr 'files for download.'
pr
msg WHI'Hit any key to continue.'OFF
Getchar
pr
Call PrintIndex(FILE,LISTS)


/*************** ERROR Routine *******************/
error:
a = SIGL;message 'Error!!!  Line # 'a;call delay 200
SysopLog 'ERROR MegaCD line # 'a


EXIT 10

syntax:
a = SIGL;message 'Syntax Error!!!  Line # 'a;call delay 200
SysopLog 'SYNTAX ERROR MegaCD line # 'a
EXIT 10

ioerr:
message 'I/O Error!!!';call delay 200
SysopLog 'IO ERROR MegaCD.'

EXIT 10
