SearchCDs - Searches index files of Amiga Active CDs,
Aminet CDs and Aminet Online files
$VER: SearchCDs 1.3 (16.8.99) (c) Neil Bothwick, Wirenet
*/
/* ;;; Initialise */
options results
signal on error
CurrStack = pragma('S',16384)
if CurrStack > 16384 then call pragma('S',CurrStack)
VerStr = sourceline(4)
VerStr = subword(VerStr,2,words(VerStr) - 4)
Title = 'SearchCDs'
GuiPort = upper(Title)
PrgPort = GuiPort'-PRG'
WinTitle = 'Amiga Active CD Search'
WinTitle = 'Amiga Active CD preferences'
qt = '22'x
CurrentDir = pragma('D')
parse var CurrentDir CDname ':' .
if left(CDName,4) ~= 'AACD' then CDname = 'AACD04'
select
when right(CurrentDir,6) = 'Aminet' then DefSearch = 'Aminet Online'
when right(CurrentDir,3) = 'CDs' then DefSearch = 'Aminet CDs'
when right(CurrentDir,4) = 'Sets' then DefSearch = 'Aminet Sets'
otherwise DefSearch = 'Amiga Active CDs'
end
;;;
/* ;;; Check for MUI */
address command 'Assign >NIL: MUI: EXISTS'
if RC > 0 then do
address command 'RequestChoice >NIL: "Amiga Active CD" "This program require Magic User Interface*NRun the Welcome script for a temporary MUI setup,*Nor install it from the CDTools drawer of the CD" "OK"'
exit
end
;;;
/* ;;; Set index variables and ensure all necessary files are available */
address command
if ~exists('C:FlashFind') then 'copy 'CDname':C/FlashFind C: clone quiet'
if exists('ENVARC:AACD/AACDIndex') then AACDPath = AddPart(GetVar('AACD/AACDIndex'),'')
else AACDPath = CDname':CDTools/indices/'
if exists('ENVARC:AACD/AminetCDIndex') then AminetCDPath = AddPart(GetVar('AACD/AminetCDIndex'),'')
if exists('ENVARC:AACD/AminetIndex') then AminetPath = AddPart(GetVar('AACD/AminetIndex'),'')
else AminetPath = CDname':AACD/Online/Aminet/'
OutFile = 'T:SearchCDs.results'
;;;
/* ;;; Define MUI variables */
MUIA_List_Quiet = 0x8042d8c7
MUIM_List_Select = 0x804252d8
MUIV_List_Select_All = -2
MUIV_List_Select_On = 1
MUIV_List_Select_Ask = 3
MUIA_List_First = 0x804238d4
MUIM_List_Remove = 0x8042647e
MUIV_List_Remove_Selected = -3
MUIA_List_Entries = 0x80421654
MUIA_List_Quiet = 0x8042d8c7
MUIA_Listview_MultiSelect = 0x80427e08
MUIV_Listview_MultiSelect_Default = 1
MUIA_Gauge_Current = 0x8042f0dd
MUIA_Gauge_Divide = 0x8042d8df
MUIA_Gauge_Horiz = 0x804232dd
MUIA_Gauge_InfoText = 0x8042bf15
MUIA_Gauge_Max = 0x8042bcdb
MUIA_Group_Columns = 0x8042f416
MUIA_Menuitem_Shortcut = 0x80422030
MUIA_Application_Active = 0x804260ab
MUIA_Application_Author = 0x80424842
MUIA_Application_Copyright = 0x8042ef4d
MUIA_Application_Description = 0x80421fc6
MUIA_Application_HelpFile = 0x804293f4
MUIA_Application_Iconified = 0x8042a07f
MUIA_Application_Title = 0x804281b8
MUIA_Application_Version = 0x8042b33f
MUIA_Application_Sleep = 0x80425711
MUIM_Application_AboutMUI = 0x8042d21d
TRUE = 1
FALSE = 0
;;;
/* ;;; Load libraries */
call LoadLib('rexxsupport.library')
call LoadLib('rexxdossupport.library')
call LoadLib('rexxreqtools.library')
;;;
/* ;;; Open arexx port and GUI */
thisport = openport(PrgPort)
if thisport = 0 then exit
address(GuiPort)
window id MAIN port PrgPort command 'QUIT' title '"'WinTitle'"'
group id ALL
group horiz attrs MUIA_Group_Columns 2
group horiz attrs MUIA_Group_Columns 2
label double 'Search string'
string id SCSTR help '"Enter a string to search for"' /*content 'test'*/
label double 'CDs to search'
cycle id CDTYP port PrgPort command 'RESCAN' help '"Which types of CD do\nyou wish to search?"' labels 'Amiga Active CDs,Aminet CDs,Aminet Sets,Aminet Online'
label double 'Output format'
cycle id OPFMT help '"Choose the output format"' labels 'HTML,Text'
endgroup
image id LOGO pict Logo.ilbm
endgroup
list id CDLST attrs MUIA_Listview_MultiSelect MUIV_Listview_MultiSelect_Default help '"Select the CDs to search"'
group id BTNS horiz
button id GO port PrgPort command 'SEARCH' help '"Start the search"' label 'Search'
button id ALL port PrgPort command 'ALL' help '"Select all CDs in the list"' label 'Select All'
button id ESC port PrgPort command 'QUIT' '"Exit without searching"' label 'Cancel'
endgroup
gauge id PROGR attrs MUIA_Gauge_Horiz MUIA_Gauge_InfoText '' help '"Shows the progress of the search"' label ''
endgroup
menu id PROJM label 'Project'
item id ABOUT port PrgPort command 'ABOUT' MUIA_Menuitem_Shortcut '?' label 'About'
item id MUI port PrgPort command 'ABOUTMUI' label 'About MUI...'
item id QUITM port PrgPort command 'QUIT' MUIA_Menuitem_Shortcut 'Q' label 'Quit'
line = '<tr><td><a href="'path'">'name'<td align=right>'strip(size)'<td align=right>'strip(age)'<td><a href="'readme'">'desc'</a>'
call writeln(out,line)
'gauge id PROGR attrs' MUIA_Gauge_Current BytesDone
end
call writeln(out,'<tr><td align=center colspan=4><p><hr><p><h5>The age is given in weeks since the date of this index ('date('N',word(statef(AddPart(IndexPath,'INDEX')),5),'I')')</h5>')
end
otherwise call ShowMsg('Not done this bit yet')
end
call writeln(out,'</table></body></html>')
call close(res)
call close(out)
/* Load HTML */
address command 'waitforport' AWebPort
if RC > 0 then call ExitMsg('Unable to start AWeb')
/*call delete(OutFile)*/
call delete(OutFile'.html')
call rename(OutFile'1',OutFile'.html')
address(AWebPort)
'open file://localhost/'OutFile'.html reload'
'screentofront'
'window tofront'
end
;;;
/* ;;; Show amigaguide */
when Format = 'AmigaGuide' then do
call ShowMsg('Not done this bit yet')
end
otherwise do
call ShowMsg('Not done this bit yet')
call close(res)
call close(out)
return
end
end
call close(res)
call close(out)
address(GuiPort)
'gauge id PROGR attrs' MUIA_Gauge_Current 0 MUIA_Gauge_InfoText '""'
return
;;;
/* ;;; List CDs for searching */
LoadList:
address(GuiPort)
'list id CDLST attrs' MUIA_List_Quiet TRUE
'application' MUIA_Application_Sleep TRUE
/* Clear list */
'method id CDLST' MUIM_List_Select MUIV_List_Select_All MUIV_List_Select_On
'method id CDLST' MUIM_List_Remove MUIV_List_Remove_Selected