RE: When is a struct not a struct ?

2008-08-05 Thread Dave Phillips
>>Hmm, so how can I reliably tell I'm holding a struct and not a CFC ? >>isStruct() and not isObject() ? I think you can tell when you are holding a struct and not a CFC like this: this is a struct this is an Object Since isObject() will only return true if it is an object, if you che

Re: When is a struct not a struct ?

2008-08-05 Thread Tom Chiverton
On Monday 04 Aug 2008, Brian Kotek wrote: > CFCs can also be treated as structures for most purposes. > StructKeyExists(), StructKeyList(), etc. will all work on a CFC instance. Hmm, so how can I reliably tell I'm holding a struct and not a CFC ? isStruct() and not isObject() ? -- Tom Chiverton

Re: When is a struct not a struct ?

2008-08-04 Thread Brian Kotek
CFCs can also be treated as structures for most purposes. StructKeyExists(), StructKeyList(), etc. will all work on a CFC instance. On Mon, Aug 4, 2008 at 7:31 AM, Tom Chiverton <[EMAIL PROTECTED]>wrote: > When is a struct (as given by isStruct()) not a struct ? > Answer: When it's a (value) obje

RE: When is a struct not a struct ?

2008-08-04 Thread Dave Phillips
>> From my understanding, I thought an object was a special kind of structure - a structure with processes (methods). On the other hand, it may look and act like an object, but it isn't one. The code below shows that you can create a structure that 'looks' like an object, (with what appears to be

Re: When is a struct not a struct ?

2008-08-04 Thread Will Tomlinson
> The following code creates an object with a few simple properties, and > dumps > this OK as an object i.e. component. > It then says that this is a struct, before confirming again it's an > object ! >From my understanding, I thought an object was a special kind of structure - a >structure

RE: When is a struct not a struct?

2004-02-07 Thread Samuel R. Neff
When you call duplicate(cfcatch) it returns a structure.  Then you can pass it to a UDF where the argument type is struct and use all struct functions on it. That's also how cfdump works.  If it gets an exception, it duplicates it. HTH, Sam --- Blog:

RE: When is a struct not a struct?

2004-02-06 Thread Cameron Childress
You might try creating an empty struct and then setting the CFCATCH into it: foo = structNew(); foo = cfcatch; Alternately, you could just use the new struct as a wrapper: foo = structNew(); foor['error'] = cfcatch; I haven't tried either, but if the first doesn't work, the second almost certai

RE: When is a struct not a struct?

2004-02-06 Thread Nathan Strutz
#cfcatch.getClass().toString()# returns "class coldfusion.runtime.CustomException" #s.getClass().toString()# returns "class coldfusion.runtime.Struct" -nathan strutz   -Original Message-   From: Craig Earls [mailto:[EMAIL PROTECTED]   Sent: Friday, February 06, 2004 8:31 PM   To: CF-T