Added note:

looking back at it, if you opt for the solution where the matches are saved to quotes.tmp, you don't even need the hidden window then, and filter straight to the temp file. It's also better not to have $lines(quotes.txt) evaluate with each line played to the channel. A global variable will do. (look at me correcting myself :tongue:)

Final code:
Code:
  
alias qsearch3 {
  %q.lines = $lines(quotes.txt)
  var %string = $+(",$1-,")
  msg $active Searching for %string
  filter -ffn quotes.txt quotes.tmp $+(*,$1-,*)
  msg $active Found $filtered quotes matching %string out of %q.lines lines.
  if $filtered { play -a MsgQuote quotes.tmp }
  .remove quotes.tmp 
}
alias MsgQuote msg $1 Line $2 / %q.lines --> $3- 


Last edited by FiberOPtics; 17/06/04 05:18 PM.

Gone.