Iif and CF 7vs. CF 8

2007-11-06 Thread Lincoln Milner
Hello, all,

I have this code snippet below which runs fine on my local workstation
(Windows XP, CF 8 IIS 5.1).  When I throw it up on our dev server
(Windows 2k3, IIS 6, CF 7) I get an index out of bounds error on the
second IIF line below.  I've looked at the docs and I don't see why
this code should not work on 7 but work fine on 8.  Anyone have any
ideas, or are you all just going to tell me to not use IIF?

Thanks!
Lincoln

cfloop from=1 to=#ListLen(form.txtFileName)# index=intCounter

cfset uploadFile(
IIF(Len(Trim(form.txtFileName)) GT 0,
Evaluate(DE(ListGetAt(form.txtFileName, intCounter))), ),
IIF((Len(Trim(form.txtFileDesc)) GT 0),
Evaluate(DE(ListGetAt(form.txtFileDesc, intCounter))), ),
form.hidCategory,
IIF((Len(Trim(form.txtEffDate)) GT 0),
Evaluate(DE(ListGetAt(form.txtEffDate, intCounter))), ),
form.hidId,
intCounter)

/cfloop

~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292729
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Iif and CF 7vs. CF 8

2007-11-06 Thread Dave Watts
 cfset uploadFile(
 IIF(Len(Trim(form.txtFileName)) GT 0,
 Evaluate(DE(ListGetAt(form.txtFileName, 
 intCounter))), ), ...

Why are you using DE inside Evaluate? The point of the DE (Delay Evaluation) 
function is to prevent the automatic evaluation that occurs within IIF.

Dave Watts, CTO, Fig Leaf Software


~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292733
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4