hey all,
How could I check if Identifiers are set?(not empty)
if ($2 != "") && ($3 != "") && ($4 != "") {
msg $chan $2
msg $chan $3
msg $chan $4
}
what's wrong with the code above?
thanks.
mIRC scripting doesn't use quoted strings (with a few exceptions); to check if a value is empty compare it with $null, ie., $4 != $null.
That said, the way mIRC's tokenization works (the way it fills $1, $2, etc.) prevents empty tokens from being allocated. So if $4 != $null then $1, $2, and $3 cannot possibly be $null either - therefore there is no need to check those.
Got it,,
or I could use if ($4) { }
thanks a lot starbucks_mafia.
Not really. if ($4) fails if $4 is 0 or $false too.
Of course, if you know your data won't include 0 or $false or if those will also be treated like $null in your script, then you can safely use that.
Or 00, 000, 0000, etc after a recent change :p
[/pedant]