The easiest way is the isDefined function.  It has apparently fallen out of
favor lately, but it will do just fine in this case.

<cfif isDefined("variables.transportation.boat.aluminum.jon")>
   <cfset JonIsThere = variables.transportation.boat.aluminum.jon>
<cfelse>
   <cfset JonIsThere = 0>
</cfif> 

-----Original Message-----
From: [EMAIL PROTECTED] [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 1:37 PM
To: CF-Talk
Subject: Correct way to test for nested members

Say I've got a structure of structures:

variables.transportation.boat.aluminum.jon

What's the correct way to test for the the definition of, say, the "jon" var,
if I'm also unsure of the presence of the containing struct(s)?

Thanks,
Jamie



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203545
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to