Not sure what the best practice is...
But I have frequently used:
<cfif edible>
</cfif>
Actually, I prefer to use <cfscript> whenever possible.
so it would be:
<cfscript>
arr_fruit=ArrayNew(1);
arr_fruit[1]="apple";
arr_fruit[2]="banana";
arr_fruit[3]="pear";
edible = ArrayAppend(arr_fruit,"pineapple");
if ( edible )
// More fruit added to arr_fruit
else
// NO fruit added
</cfscript>
HTH,
Josh
---
Exciteworks -- expert hosting for less!
http://exciteworks.com
specializing in reseller accounts
David Adams wrote:
> 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]
- Re: Best practises question Jochem van Dieten
- RE: Best practises question Taco Fleur
- RE: Best practises question Tom Kitta
- Re: Best practises question Jochem van Dieten
- RE: Best practises question Taco Fleur
- Changing HTML text to ima... Stuart Kidd
- Re:Changing HTML tex... Josen Ruiseco
- RE: Best practises question Tony Weeg
- RE: Best practises question Qasim Rasheed
- RE: Best practises question Tony Weeg
- RE: Best practises question Josh
- RE: Best practises question Stephen Barry
- RE: Best practises question Hagan, Ryan Mr (Contractor ACI)