If you want to indicate a failure in your CFC, why not simply cfthrow an
error? You can set both a type, details, and message for the error.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Alexander Sherwood [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, September 23, 2002 3:12 PM
> To: CF-Talk
> Subject: Return Variables for CFCs
> 
> 
> 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
> 
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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

Reply via email to