mIRC Home    About    Download    Register    News    Help

Print Thread
#201757 03/07/08 10:50 PM
Joined: Feb 2006
Posts: 22
B
BIGZIPZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Feb 2006
Posts: 22
Hi there, I am a beginner. I understand that $read can be used to scan a text file to find a match e.g:

Code:
msg $chan $read("HiLo.txt", s, Bob)


I have the above code which returns the line of text in the file which begins with "Bob". My question is: is there a way, to do:

If when reading this file, there IS a line which starts with Bob do something, if not, do something else. Thank you.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

You could do this...

Code:

if ($read(HiLo.txt, s, Bob) != $null) {
  msg $chan $v1
}
else {
  do_something_else_here
}



Joined: Feb 2006
Posts: 22
B
BIGZIPZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Feb 2006
Posts: 22
Thank you very much. Funny how the answer is so obvious but I never thought about this way!


Link Copied to Clipboard