<html>
<font size=3>I think it is as follows:<br>
When a CFMODULE is called, the arguments in the CFMODULE tag are put into
the module's 'attributes' structure. They are NOT put into anything in
the caller's scope. So if you call: <CF_mytag a=#a# b=#c#> the
"a" in the caller's scope already exists before the call, and
the "a" passed as an argument is created at the module call as
attributes.a and is NOT the same variable as caller.a . After the
call you would have the following:<br>
<br>
Caller
scope<x-tab> </x-tab><x-tab> </x-tab>mytab's
scope<br>
----------------<x-tab> </x-tab><x-tab> </x-tab>-------------------<br>
variables.a<x-tab> </x-tab><x-tab> </x-tab>attributes.a
( = local variable with same value as caller.a)<br>
variables.c<x-tab> </x-tab><x-tab> </x-tab>attributes.b
( = local variable with same value as caller.c)<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab>caller.a
( = the caller's variables.a)<br>
<x-tab> </x-tab><x-tab> </x-tab><x-tab> </x-tab>caller.c
( = the caller's variables.c)<br>
<br>
Anyway, the best thing to do is to make a 3 line test file that sets some
variables and calls a 3 line modules. Print out everything along the way
and test it to see for sure.<br>
<br>
At 09:11 AM 8/22/00 -0500, Carol Chandler wrote:<br>
<blockquote type=cite cite>You're the only person who has taken a stab at
this, so thank you very much! <br>
<br>
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*<br>
<br>
Thanks,<br>
Carol<br>
<br>
>>> [EMAIL PROTECTED] 08/21/00 04:53PM >>><br>
Hi, Carol.<br>
<br>
Perhaps your recursive invocation of cf_output_unknown needs to
pass<br>
caller.message as the message= argument rather than the
attributes.message.<br>
I may be getting wrapped around the recursion here, but it seems to me
that<br>
within a given invocation of cf_output_unknown you modify
caller.message<br>
with by appending the value of the argument test_object (or an element
of<br>
it) to the value of the message argument. But then you pass the
unmodified<br>
attributes.message to the next level of recursion. (Of course, if in
the<br>
final analysis the caller and attributes scopes actually point to the
same<br>
value because of the recursion then this advice doesn't mean much.)<br>
<br>
HTH,<br>
-- Tim Dempsey<br>
<br>
<br>
-----Original Message-----<br>
From: Carol Chandler
[<a href="mailto:[EMAIL PROTECTED]"
eudora="autourl">mailto:[EMAIL PROTECTED]</a>]
<br>
Sent: Monday, August 21, 2000 4:48 PM<br>
To: [EMAIL PROTECTED] <br>
Subject: Help with custom tag<br>
<br>
<br>
Hi list, <br>
<br>
I'm working on my very first custom tag. I was writing a specific
routine<br>
to collect the contents of the CFCATCH structure when it occurred to me
that<br>
a more general solution might be useful. So, what this tag is
intended to<br>
do is to take a variable - simple, array, or structure, or any
combination<br>
(array of structures of arrays, etc.) - and append all of the
component<br>
names and values into one string. What I have here does correctly
traverse<br>
and output a nest of structures/arrays, but I can't seem to collect it
all<br>
into one variable. There must be more to
"caller.variable" than meets the<br>
eye. What happens in the calling page is that "message"
has the name of the<br>
last component of the outer structure.<br>
<br>
Can anyone tell me what I am missing? Thanks very much. (And
I hope the<br>
recursion doesn't give anyone a headache!)<br>
<br>
<!--- CF_output_unknown [input] test_object [output] message
-><br>
<br>
<cfif IsDefined("attributes.test_object") IS
"No"><br>
<x-tab> </x-tab><cfset
#caller.message# = ""><br>
<cfelseif #IsSimpleValue(attributes.test_object)#><br>
<x-tab> </x-tab><cfoutput>#attributes.test_object#</cfoutput>
<br>
<x-tab> </x-tab><cfset
#caller.message# = #attributes.message# &<br>
#attributes.test_object#><br>
<cfelseif #IsStruct(attributes.test_object)#><br>
<x-tab> </x-tab><CFLOOP
COLLECTION=#attributes.test_object# item="struct"><br>
<x-tab> </x-tab><x-tab> </x-tab><cfset
#caller.message# = #attributes.message# & #struct# &<br>
" = "><br>
<x-tab> </x-tab><x-tab> </x-tab><cfoutput><BR>#struct#
= </cfoutput> <br>
<x-tab> </x-tab><x-tab> </x-tab><CF_output_unknown<br>
test_object=#attributes.test_object[struct]#
message=#attributes.message#><br>
<x-tab> </x-tab></CFLOOP><br>
<cfelseif #IsArray(attributes.test_object)#><br>
<x-tab> </x-tab><CFLOOP
index=i from=1 to= #arrayLen(attributes.test_object)#><br>
<x-tab> </x-tab><x-tab> </x-tab><CF_output_unknown
test_object=#attributes.test_object[i]#<br>
message= #attributes.message#><br>
<x-tab> </x-tab></cfloop><br>
<cfelse><br>
<x-tab> </x-tab><Cfset
#caller.message# = #attributes.message# & "Unable to
proceed<br>
with CF_output_unknown."><br>
</cfif><br>
<br>
<br>
----------------------------------------------------------------------------<br>
--<br>
Archives:
<a href="http://www.mail-archive.com/[email protected]/"
eudora="autourl">http://www.mail-archive.com/[email protected]/</a>
<br>
To Unsubscribe visit<br>
<a href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk"
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk</a>
or<br>
send a message to [EMAIL PROTECTED] with 'unsubscribe' in<br>
the body.<br>
------------------------------------------------------------------------------<br>
Archives: <a href="http://www.mail-archive.com/[email protected]/"
eudora="autourl">http://www.mail-archive.com/[email protected]/</a> <br>
To Unsubscribe visit <a
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk"
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.<br>
<br>
------------------------------------------------------------------------------<br>
Archives: <a href="http://www.mail-archive.com/[email protected]/"
eudora="autourl">http://www.mail-archive.com/[email protected]/</a><br>
To Unsubscribe visit <a
href="http://www.houseoffusion.com/index.cfm?sidebarsts&bodysts/cf_talk"
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebarsts&bodysts/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body. </font></blockquote><br>
<br>
-<font
size=3>--------------------------------------------------------------------------<br>
Peter Theobald, Chief Technology Officer<br>
LiquidStreaming <a href="http://www.liquidstreaming.com/"
eudora="autourl">http://www.liquidstreaming.com</a><br>
[EMAIL PROTECTED]<br>
Phone 1.212.545.1232 Fax 1.212.679.8032<br>
</font></html>
------------------------------------------------------------------------------
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.