On 8/22/00, Carol Chandler penned:
>It is my understanding that caller.message and attributes.message 
>point to the same thing, but that any modifications that refer to it 
>as "attributes.message" will be strictly local to that invocation of 
>the tag.  Is anyone willing to help with my understanding of caller 
>vs. attribute, without necessarily getting too involved in the 
>headache-y recursion? *grin*

The most succinct way I can put it is:

Anything passed to a custom tagged gets handed to the attributes scope.

<CF_YourTag
parameter1="test"
parameter2="test2"
>

You must access parameter1 and parameter2 as attributes.parameter1 
and attributes.parameter2 inside the custom tag.

If that tag does some processing that you must access after and 
outside of the tag, it must be called with the caller scope.

If inside the tag, you have:

<cfset result = "Yes!">

Then inside the tag, you can use:

<cfoutput>#result#</cfoutput> (or variables.result)

But outside the tag you will get an error.

If you want to access "result" outside the tag, then inside the tag 
you'll need to do:

<cfset caller.result = "Yes!">

In which case <cfoutput>#result#</cfoutput> (or variables.result) 
will work outside and after the tag.

If you need to access "result" inside and outside of the tag, you'll 
need to set it twice.

<cfset result = "Yes!">
<cfset caller.result = result>

I think all that is correct. :)
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to