Reputation: 19
I have an if statement and I want to check against multiple variables, but I want any combination of the variables are valid.
<cfif var1 AND OR var2 AND OR var3>
execute
<cfelse>
NO
</cfif>
Update from comments:
The variables return boolean values
Upvotes: 1
Views: 165
Reputation: 14333
you would just use OR
and exclude using AND
If var1
var2
or var3
were true then your code would execute
If var1
is a boolean then saying var1
is accurate
If var1
is a string you would check len(trim(var1))
If var1
is a number you would check var1 GT 0
<cfif var1 OR var2 OR var3>
execute
<cfelse>
NO
</cfif>
Upvotes: 5