mIRC Home    About    Download    Register    News    Help

Print Thread
#199411 13/05/08 11:30 PM
A
AWEstun
AWEstun
A
If this works:

if ($read(name.txt,w,$1 $+ *) = $null) {

why won't this work:

if (!$read(name.txt,w,$1 $+ *)) {

???

#199412 13/05/08 11:32 PM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
remove the space between the ! and $read

RusselB #199414 13/05/08 11:48 PM
A
AWEstun
AWEstun
A
Uhm, there is no space between ! and $read

#199418 14/05/08 01:13 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
ok.. maybe it's this board, but to me it looked like there is.. the other possibility that I can see is that your search isn't returning a response that matches $null.. I noticed that you're doing the 2nd comparison with a different file than the first, so is it possible that the second file has a match for your search?

RusselB #199420 14/05/08 01:38 AM
A
AWEstun
AWEstun
A
It should be the same filename.

#199421 14/05/08 02:00 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
hmm.. looking at your original post now, it is using the same filename.. I could've sworn it wasn't earlier.. in any case, if all of the parameters are the same, then the !$read should work

#199423 14/05/08 02:07 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
First of all, when doing a comparison that is equal, you should be using == and not =.

Beyond that, keep in mind that the first one only is true if the result is $null. The second one is true when the result is $null, 0, or $false. The 0 can often cause issues for people who try doing it this way instead of using == $null.

Riamus2 #199427 14/05/08 05:32 AM
A
AWEstun
AWEstun
A
if (!$read(name.txt,w,$1 $+ *)) {

is working now.

#199432 14/05/08 07:43 AM
Joined: Oct 2003
Posts: 3,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
I'll bet this had nothing to do with your syntax and everything to do with what $read was returning.. ie. it wasn't finding anything in the file.

There's a good debugging tutorial at http://kthx.net/ftb which may cover how to tackle problems like these in the future.


Link Copied to Clipboard