I don't think you can use IIF in this case as IIF has
a habit of evaluating both results regardless of
whether it resolves to true or false. Even if
proximity doesn't exist, it will still evaluate
values[i]["proximity"].
Cheers
>
> I've got an array of structures and am looping
> through them and writing
> several queries on the fly. However, I can't hit on
> just the right
> combination of quotation marks to stop it throwing
> an error.
>
> Does anyone know how to write it correctly,
> outputting either null or
> the value surrounded by apostrophes?
>
> #Iif(not StructKeyExists(values[i], "proximity"),
> DE("null"), "'" &
> "values[i]["proximity"]" & "'"))#
>
>
> Thanks!
>
> --
> Aidan Whitehall <[EMAIL PROTECTED]>
> Macromedia ColdFusion Developer
> Fairbanks Environmental Ltd +44 (0)1695 51775
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4