home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 11 / AACD11.ISO / AACD / Magazine / Database / Search.awebrx < prev   
Text File  |  2000-07-03  |  2KB  |  46 lines

  1. /*
  2.     $VER: 1.0 Search.awebrx (1-7-2000)
  3.     By Neil Bothwick
  4.  
  5.     Searches Amiga Active database on AACD.
  6. */
  7.  
  8. options results
  9. CDName = 'AACD11'
  10. AWebPort = address()
  11. DBdir = CDName':AACD/Magazine/Database/'
  12.  
  13. parse arg args
  14. call addlib('rexxsupport.library',0,-30,0)
  15. SearchStr = ''
  16. interpret args
  17. if SearchStr = '' then exit
  18. address command 'FlashFind >T:IndexSearch.results' DBdir'index "'SearchStr'" NH'
  19.  
  20. call open(out,'T:IndexSearch.html','W')
  21. call writeln(out,'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">')
  22. call writeln(out,'<html><head><title>Search results</title></head><body bgcolor=white>')
  23. call writeln(out,'<h3 align="center">Result of searching for "<font color="red">'SearchStr'</font>"</h3>')
  24.  
  25. if word(statef('T:IndexSearch.results'),2) = 0 then call writeln(out,'<h4 align="center">No matches found</h4>')
  26. else do
  27.     call writeln(out,'<table align="center" border="0">')
  28.     call writeln(out,'<tr><th width="80%">Title</th><th width="20%">Issue</th><tr>')
  29.     call open(in,'T:IndexSearch.results','R')
  30.     do until eof(in)
  31.         line = readln(in)
  32.         if line = '' then iterate
  33.         parse var line File '|' IssueDate '|' Title '|' .
  34.         parse var File IssueNum '-' .
  35.         call writeln(out,'<tr align="left" valign="top"><td><a href="file://localhost/'DBdir||File'">'Title'</a></td>')
  36.         call writeln(out,'<td align="center"><a href="file://localhost/'DBdir||'Issue'IssueNum'.html">'IssueDate'</a></td></tr>')
  37.         end
  38.     call close(in)
  39.     call writeln(out,'</table>')
  40.     end
  41.  
  42. call writeln(out,'</body></html>')
  43. call close(out)
  44.  
  45. 'Open "file://localhost/T:IndexSearch.html" reload'
  46.