|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
remove the space between the ! and $read
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
Uhm, there is no space between ! and $read
I registered; you should too.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
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?
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
It should be the same filename.
I registered; you should too.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
if (!$read(name.txt,w,$1 $+ *)) {
is working now.
I registered; you should too.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
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"
|
|
|
|
|
|