<cfif edible>


Is the easiest to write, however not the fastest to execute


<cfif variables.edible EQ TRUE>


executes faster


And its best practice to always scope your variables.


<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")>


I also not sure that your example really displays correctly, i.e. you are
creating an array and in the cfif example you check a simple value for yes,
true or 1


<!--- <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>


While it should be


<!--- <cfif edible[1] IS "apple"> --->
Etc...

Taco Fleur
Blog  <http://www.tacofleur.com/index/blog/>
http://www.tacofleur.com/index/blog/
Methodology http://www.tacofleur.com/index/methodology/
0421 851 786
Tell me and I will forget
Show me and I will remember
Teach me and I will learn
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to