userfunc check if NOT true [userFunc != user_myfunc]

nbar

I try to check if a userFunc is NOT true.

It works with ELSE:

[userFunc = user_myfunc]
    #function returns true
[ELSE]
    #function returns false
[end]

But what I realy want is: (that does not work!)

[userFunc != user_myfunc]
    #function returns false
[end]

Is it possible to do something like that?

The reason I want to do it is: I want to check if myfunc is false and myfunc2 is true. Something like this:

[userFunc != user_myfunc] && [userFunc = user_myfunc2]
    #user_myfunc returns false & user_myfunc2 returns true
[end]
nbar

I solved this problem by adding a "not" parameter to my function.

[userFunc != user_myfunc]

is getting:

[userFunc = user_myfunc(not)]

and in the function itself I do:

if($not=="not") { // $not is the parameter of the function
        return !$returnvalue; // so is the parameter set to "not" I return the oposide.
    } else {
        return $returnvalue;
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related