of course.

but as a "Best Practice" since edible may not *always* be defined or have a
value
I would consider it a best practice to check for the presence and the value
and the slickest
way ive seen so far is that udf.  that's all.

tony

-----Original Message-----
From: Qasim Rasheed [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 29, 2004 9:38 AM
To: CF-Talk
Subject: RE: Best practises question

Can't you just use


<cfif edible>
<cfelse>
</cfif>


Qasim

-----Ori
ginal Message-----
From: David Adams [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 29, 2004 7:59 AM
To: CF-Talk
Subject: Best practises question

In the following snippet, what is better form for representing a true
statement in the CFIF (ie. "YES", true, or 1)?

<cfset arr_fruit=ArrayNew(1)>
<cfset arr_fruit[1]="apple">
<cfset arr_fruit[2]="banana">
<cfset arr_fruit[3]="pear">
<cfset edible = ArrayAppend(arr_fruit,"pineapple")>

<!--- <cfif edible IS "YES"> --->
or
<!--- <cfif edible IS true> --->
or
<cfif edible IS 1>
More fruit added to arr_fruit
<cfelse>
NO fruit added
</cfif>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to