Originally Posted By: Wims
Originally Posted By: LostShadow
1. %VariableThatDoesNotExist is null.

Code:

echo $chan this part triggers
if ($eval($+(%,VariableThatDoesNotExist,$nick),2) != $null) {
blah blah
}
echo $chan this part triggers
else {
echo $chan This part does not trigger.
}



Since it does not triger for the != $null, it should trigger for else { }, right?
No, an else/elseif have to be used directly after the if statement.


So you're saying the /echo got in the way?

Quote:
Originally Posted By: LostShadow
2.

mIRC goes crazy when it comes to variables that does not exist.

I have.

%seenchans #list,#of,#channels

If I have.

elseif (($istok(%seenchans,$target,44)) || ($target == $me)) {

Will only trigger for %seenchannels.

But if I have..

elseif (($istok(%seenchans,$target,44)) || ($target == $me)) && ($istok(%VariableThatDoesNotExist,$target,44)) !ison $target) {

It will trigger for all channels.

Quote:
elseif (($istok(%seenchans,$target,44)) || ($target == $me)) {
This line is correct, i'm not sure why it's not working for you but :


It does work for me. It only triggering for %seenchans is what I want. But when I add the &&, it triggers for non-seenchans too.

Quote:
Quote:
elseif (($istok(%seenchans,$target,44)) || ($target == $me)) && ($istok(%VariableThatDoesNotExist,$target,44)) !ison $target) {
This line is wrong in any case because $istok can only return $true or $false, so you trying to do something like //if ($true/$false !ison $target) { } and because of the &&, this will never work


Which is why removing it solves the problem. But I don't see why it has no longer follow %seenchans and work for non-seenchans too.

-Neal.