Failing IF statement - 25/05/14 01:56 AM
I suppose that I am attempting to read the name of this variable wrong, so perhaps that is why this if statement is not working properly.
Using:
set %new. $+ [ # [ $+ [ $nick ] ] ] 1
I am able to set the variable perfectly fine: %new.#user 1
But when I check whether or not that variable exists using this, I run into problems.
That if statement wont go to else if %new.#user does not exist. It will only execute the line that states that it exists although it does not. I figure it may be something that I'm just overlooking, or even the syntax of attempting to retrieve the variable may be wrong. Hopefully someone can assist me on this, so I can put it behind me.
Thank you
Using:
set %new. $+ [ # [ $+ [ $nick ] ] ] 1
I am able to set the variable perfectly fine: %new.#user 1
But when I check whether or not that variable exists using this, I run into problems.
Code:
if (%new. $+ [ # [ $+ [ $nick ] ] ] != $null) { msg $chan Exists } else { msg $chan Does not exist }
That if statement wont go to else if %new.#user does not exist. It will only execute the line that states that it exists although it does not. I figure it may be something that I'm just overlooking, or even the syntax of attempting to retrieve the variable may be wrong. Hopefully someone can assist me on this, so I can put it behind me.
Thank you