Hello everyone,
I'm stumped as to why the following is not working. First let me explain what the code is supposed to do:
I have a text file, which contains approximately 90,000 lines (quotes).
I wanted to be able to let people enter a few words, and search the text file for that string and display the result. I realize right now it only does an echo, because I didn't want to flood the channel with silly things as I was trying to work.
on *:TEXT:*:*: {
if (quote isin $2) {
%posty.search.string = $strip($4-)
var %posty.asterisk = *
var %posty.length = $len(%posty.search.string) - 1
%posty.search.string = $left(%posty.search.string,%posty.length)
%posty.search.string = $right(%posty.search.string,-4)
%posty.search.string = %posty.asterisk $+ %posty.search.string $+ %posty.asterisk
%posty.search.string = $strip(%posty.search.string)
echo -s Now searching for %posty.search.string
%posty.answer = $read($mircdirquotes.txt, w, %posty.search.string)
echo -s Result %posty.answer
}
}
I realize it is not optimized in any way, but the result of this exercise is that I get no results.
The strange thing is the following:
If I copy and paste the %posty.search.string in to the Find dialog box in my text editor I get no results either, but if I type the text, exactly as I see it, it finds it. I $strip the code and yet there seems to be something there that is throwing off the result.
If you are wondering why I'm trimming it left and right, is because sometimes people enter extra space or a question mark, so I figured I would remove them before I added the asterisk for the wildcard search for $read.
Any help, suggestion, nudge in the right direction will be very much appreciated
Thank you.