IIf() will attempt to evaluate all expressions in the statement at once. So, if the key doesn't exist it will fail when it tries to determine the value of proximity.
-----Original Message----- From: Aidan Whitehall [mailto:[EMAIL PROTECTED]] Sent: 21 February 2003 10:08 To: [EMAIL PROTECTED] Subject: RE: [ cf-dev ] Iif() and StructKeyExists() > this should work: > > #iif(not structKeyExists(values[i], "proximity"), de("null"), de("'#values[i].proximity#'"))# Unfortunately not. It's now displaying: "Element DISTANCE is undefined in a CFML structure referenced as part of an expression." Oh, and thx for the 2 brackets, Kola. Soddit... I've rewritten it using cfif and it works. Thanks all for the help, anyway. -- Aidan Whitehall <[EMAIL PROTECTED]> Macromedia ColdFusion Developer Fairbanks Environmental Ltd +44 (0)1695 51775 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
