Question:
When returning variables from CFCs, has anyone figured out a decent way to
wrap the return variable in a container?
I've done something like this, but it gets to be a pain in the a*s
duplicating the code:
<cfscript>
stReturn = structNew();
stReturn.bOK = 1;
stReturn.details = '';
stReturn.result = '';
</cfscript>
Normally, the function result is stuffed in the "result" key, and the whole
struct is returned. If the method call fails, bOK is set to 0 and the
details key contains error info when the struct is returned.
What would be the most efficient way to duplicate the code in each function
call? Just curious to see some suggestions.
Thanks,
----------------------------------
Alex Sherwood
PHS Collection Agency
THE COLLECTORS
301.215.4200 T
301.664.6834 F
www.phs-net.com
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists