/*      $VER: GDDC.AMIRX 1.0 (4.22.97) Viewer Script for GDCC           */
/*  .Guide view from Amirc, u have to view GDCC .guides using this...   */
/*  install as a button on amirc.... Guide....REad Amirc.guide for help */
/*  Edit below                                                          */
/*                Bossman^   bosman@erols.com                           */
/*----------------------------------------------------------------------*/

if ~show('L','rexxreqtools.library') then
		if ~addlib('rexxreqtools.library',0,-30,0) then do
			cecho("Unable to load rexxreqtools.library")
			exit
		end

if ~show('L','rexxsupport.library') then
		if ~addlib('rexxsupport.library',0,-30,0) then do
			cecho("Unable to load rexxsupport.library")
			exit
		end

PARSE ARG nick
Options results
GETDCCRECEIVEDIR
dload6 = result
colour=6         
Amiport=address()
setclip("amiport",amiport)
"INFO screen"
pubs='"'||result||'"'
if pubs= '""' then pubs='Workbench' 


if getclip("dccgdccview") = 'yes' then do 
    file = getclip("gdccmovefile")
    howshow() 
   end 
else
   if pos('GDCC',(upper(showlist('A')))) = 0 then 
      dload =''""||dload6||""''
    else
      dload='GDCC:'

file = RTFILEREQUEST(dload,,'Guide File To view',,'RTFI_BUFFER=TRUE RT_REQPOS=REQPOS_CENTERSCR RT_PUBSCRNAME='pubs 'rtfi_matchpat=#?.guide')
rtfreefilebuffer()

IF file = '' THEN DO
  cecho('No Guide Selected!')
  EXIT 
  END
howshow()

end
exit



howshow:

showscreen = 'pubscreen '||pubs
setclip("dccgdccview")
view = 'Sys:Utilities/multiview' 

ADDRESS COMMAND view showscreen '"'file'"'
setclip("gdccmovefile")
EXIT 

cecho:     
"ECHO P="d2c(27)"b«"GDCC"» C="colour arg(1)
return 0

