> The one place I've found that I really like the IIF is to use
> it in areas like the following code sample:
>
> <input type="checkbox"
>        name="#REQUEST.cReorderFormArtPrefix##ReorderJob.ljob#"
>        value="Yes"
>        
> #IIF(laReorderJobs[lnLoop][REQUEST.cReorderFormArtPrefix] NEQ "",
>             DE("CHECKED"), DE(""))#>
>
> I found using it this way is much more readable in my code
> then using <CFIF> and having to code the almost identical
> <INPUT> tag twice with only the "CHECKED" option in or out.

I prefer not using DE() as it can be horribly slow

#IIF(laReorderJobs[lnLoop][REQUEST.cReorderFormArtPrefix] NEQ "",
"'CHECKED'", "''")#

Once you are used to it, it's just as readable

Although, I don't use IIF() that often as I tend to do things like this
in CFSCRIPT and set a variable to put there;

<cfscript>
   checkField="";
   if (Len(laReorderJobs[lnLoop][REQUEST.cReorderFormArtPrefix]))
   {
      checkField="checked";
   }
</cfscript>
<input type="checkbox" value="Yes" #checkField#
   name="#REQUEST.cReorderFormArtPrefix##ReorderJob.ljob#">
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to