James A Mohler
James A Mohler

Reputation: 11120

Use of IS outside of <cfif>

I am not quite sure what this does.

<cfset User.ZeroBDK = FORM.ZeroBDK is "YES">

Is this short hand for

<cfset User.ZeroBDK = false>
<cfif FORM.ZeroBDK EQ "Yes">
     <cfset User.ZeroBDK = true>
</cfif>

Are there other truthy things that get set to true?

Upvotes: 1

Views: 65

Answers (1)

Alex Baban
Alex Baban

Reputation: 11732

The (FORM.ZeroBDK is "YES") expression will evaluate to true or false depending on what is in FORM.ZeroBDK,

so <cfset User.ZeroBDK = FORM.ZeroBDK is "YES">

will give to User.ZeroBDK a boolean value of true or false.


I'm just speculating..., but if you got this from some legacy code, it seems like not the best way to determine if FORM.ZeroBDK has something in it.

Upvotes: 1

Related Questions