home *** CD-ROM | disk | FTP | other *** search
/ Dream 46 / Amiga_Dream_46.iso / Amiga / Internet / Irc / ChatBox1_164.lha / Rexx / aminetfind2.cb < prev    next >
Text File  |  1997-10-24  |  847b  |  46 lines

  1. /**/
  2.  
  3. indexfile='dh2:net/index'
  4.  
  5. parse arg keywords
  6.  
  7. if keywords='' then do
  8.     CMD '/echo Usage: /find [-opts] keywords'
  9.     exit
  10. end
  11.  
  12. keys=1
  13.  
  14. length=10
  15. width=80
  16.  
  17. say=0
  18.  
  19. do while left(keywords,1)='-'
  20.     opt=word(keywords,1)
  21.     opt=upper(right(opt,length(opt)-1))
  22.     if opt='SAY' then say=1
  23.     parse var keywords .' 'keywords
  24. end
  25.  
  26. if ~showlist(H,'TCP') then address command 'mount TCP: from amitcp:devs/inet-mountlist'
  27. if ~showlist(H,'TCP') then address command 'mount TCP:'
  28. if showlist(H,'TCP') then do
  29.     if open(1,'TCP:find.germany.aminet.org/1848',w) then do
  30.         call writeln(1,'find 'keywords)
  31.         call writeln(1,'quit')
  32.         linecnt=0
  33.         do until eof(1)
  34.             text=readln(1)
  35.             linecnt=linecnt+1
  36.             if linecnt<=length then do
  37.                 if text~='' then do
  38.                     CMD '/echo' text
  39.                 end
  40.                 else linecnt=linecnt-1
  41.             end
  42.         end
  43.         CMD '/echo' linecnt' matches found.'
  44.     end
  45. end
  46.