You'd have to maintain a list of all the variables you visit, and see if each variable is listed before outputting it. I'm not sure exactly what you could use to track each unique object. the hashCode() method would work, but it could possibly result in variables being hidden. Probably your best bet.
Also, you'd have to come up with some nice way of indicating that a variable has already been processed in the output, and reference what variable it is recusrively refering to. Of course, this begs the question, why do you have a recursive structure such as that? Nothing jumps into my mind as a good reason to do that, unless you're using the structs to build a graph of some kind. barneyb --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Brad Howerter > Sent: Thursday, August 21, 2003 1:05 PM > To: '[EMAIL PROTECTED]' > Subject: [CFCDev] cfdump problem > > > I'd like to write a replacement for cfdump that doesn't enter an endless > loop if it encounters a recursive structure. Is that possible? > How would I > know whether I've encountered a structure before? Here's an > example of some > code that will cause cfdump to recursively loop until your page times out: > > <cfset st = structNew()> > <cfset st.abc = st> > <cfdump var=#st#> > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003 ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
