This content has been marked as final. Show 5 replies
1. <cfobject component="Component_Name" name="Obj_Name">
2. Obj = CreateObject("Component", "Obj_Name");
(This should be inside <script> tag)
3. <cfinvoke component = "component name or reference" method = "method name" returnVariable = "variable name" argumentCollection = "argument collection">
For more informations see the livedocs.
None of that has anything to do with cloning a component instance though.
Can't be done in natively CF, sorry, Johnny852. The best you can do is
roll-yer-own clone() (although you'll have to call it something else, as
Java will screech if you try calling it "clone") method which creates
another instance of the same component, and then loops through the
variables and this structs and copies the values from the original into the
new one (needless to say, the cloning could end up being recursive if any
of those this/variables values are themselves CFC-instances).
It's all a bit suck, really.
> haha says you cameron.
> I have got quite a good ObjectCloner.cfc, but i can't upload it here :(
Which, Rhys, does exactly what I suggested.
NB: that code is (copyrighted) Straker Interactive IP. Not for public
(Technical Manager, Straker Interactive, when on official duty)