mIRC Home    About    Download    Register    News    Help

Print Thread
#199411 13/05/08 11:30 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
If this works:

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

why won't this work:

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

???


I registered; you should too.
AWEstun #199412 13/05/08 11:32 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
remove the space between the ! and $read

RusselB #199414 13/05/08 11:48 PM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
Uhm, there is no space between ! and $read


I registered; you should too.
AWEstun #199418 14/05/08 01:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
It should be the same filename.


I registered; you should too.
AWEstun #199421 14/05/08 02:00 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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

AWEstun #199423 14/05/08 02:07 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #199427 14/05/08 05:32 AM
Joined: May 2008
Posts: 329
A
AWEstun Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: May 2008
Posts: 329
if (!$read(name.txt,w,$1 $+ *)) {

is working now.


I registered; you should too.
AWEstun #199432 14/05/08 07:43 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard