mIRC Homepage
Posted By: noMen Negated identifiers in echo - 11/09/07 11:08 AM
Why do I get these "strange" results:

Code:
t {
  var %a = abc def ghi
  if (!$istok(%a, $1, 32)) {
    echo -a no
  }
  else {
    echo -a yes
  }
  echo -a 1: !$istok(%a, $1, 32)
  echo -a 2: $istok(%a, $1, 32)
}

On /t abc I get the following results:
yes
1: !$istok(%a, abc, 32)
2: $true

On /t xyz I get the following results:
no
1: !$istok(%a, xyz, 32)
2: $false

Why isn't a negated identifier being echoed correctly? Btw I still use mIRC 6.17.
Posted By: qwerty Re: Negated identifiers in echo - 11/09/07 11:23 AM
The exclamation mark in front of an identifier only has special meaning inside an /if condition; in all other cases it has the same effect as any other char touching an identifier, ie it prevents the evaluation of the latter.
© mIRC Discussion Forums