home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 5
/
AACD05.ISO
/
CDTools
/
S
/
QuickSearch.awebrx
< prev
next >
Wrap
Text File
|
1999-12-08
|
2KB
|
62 lines
/*
$VER: QuickSearch.awebrx 1.0 (2.9.99) (c) Neil Bothwick, Wirenet
QuickSearch - Searches the index of the current CD
*/
/* ;;; Initialise */
options results
CDname = 'AACD05:'
IndexFile = CDName'CDTools/indices/'compress(CDName,':')
TempFile = 'T:QuickSearch.temp'
ResultFile = 'T:QuickSearch.html'
AWebPort = address()
;;;
/* ;;; Search index file */
parse arg SearchStr
SearchStr = translate(SearchStr,' ','+')
address command CDName'System/C/FlashFind >'TempFile IndexFile '"'SearchStr'" NOPREFS QUIET NH'
if RC > 0 then call ExitMsg('No matches found for *"'SearchStr'*"')
;;;
/* ;;; Open output file and write headers */
call open(in,TempFile,'R')
call open(out,ResultFile,'W')
call writeln(out,'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">')
call writeln(out,'<html><head><title>Search results</title></head><body bgcolor=white>')
call writeln(out,'<h3 align=center>Result of searching for "<font color=red>'SearchStr'</font>"</h3>')
call writeln(out,'<table width="100%">')
;;;
/* ;;; Process result into HTML */
do until eof(in)
line = readln(in)
if line = '' then iterate
parse var line name =34 path
name = strip(name)
line = '<tr><td>'name'<td><a href="x-aweb:rexx/'left(path,pos(':',path))'CDTools/S/ShowDir 'PathPart(path)'">'path'</a>'
call writeln(out,line)
end
call writeln(out,'</table></body></html>')
;;;
/* ;;; Close files and load into AWeb */
call close(in)
call close(out)
address command 'delete >NIL:' TempFile
'open file://localhost/'ResultFile' target main reload'
'wait file://localhost/'ResultFile
address command 'delete >NIL:' ResultFile
;;;
exit
/* ;;; Exit with a message */
ExitMsg:
parse arg msg
'request title "AACD QuickSearch" body "'msg'" gadgets "OK"'
exit
return
;;;