"Hope That Helps"

HTH,

Ray  :)

Johnny Le wrote:
> Yep, I am currently using the second method. Thanks, Sean.
> 
> What is HTH?
> 
> Johnny
> 
> 
>>On 6/17/05, Johnny Le <[EMAIL PROTECTED]> wrote:
>>
>>>I have a cfc.  I am trying to convert several variables into 
>>
>>attributes variables from inside a method, but of course, these 
>>variables are not available outside the cfc.  I can convert them into 
>>form or URL variables, but not attributes.  Is there a way I can make 
>>these attributes available outside the cfc?
>>
>>CFCs are encapsulated to prevent that sort of thing.
>>
>>However, if you pass in the attributes struct as an argument to your
>>method, the method can store values into it via the argument:
>>
>>In the CFC:
>><cffunction name="foo">
> 
>   
> 
>><cfargument name="attributes" type="struct">
> 
>   
> 
>><cfset arguments.attributes.answer = 42>
>></cffunction>
>>
>>In the calling code:
>><cfset myObj.foo(attributes)>
>>
>>Another option would be to create and return a struct in the function
>>and have the calling code append that to its attributes:
>>
>>In the CFC:
>><cffunction name="foo" returntype="struct">
> 
>   
> 
>><cfset var attr = structNew()>
> 
>   
> 
>><cfset attr.answer = 42>
> 
>   
> 
>><cfreturn attr>
>></cffunction>
>>
>>In the calling code:
>><cfset newAttr = myObj.foo()>
>><cfset structAppend(attributes,newAttr)>
>>
>>HTH
>>-- 
>>Sean A Corfield -- http://corfield.org/
>>Team Fusebox -- http://fusebox.org/
>>Got Gmail? -- I have 50, yes 50, invites to give away!
>>
>>"If you're not annoying somebody, you're not really alive."
>>-- Margaret 
> 
> Atwood
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209885
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to