<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: &lt;CF_mytag a=#a# b=#c#&gt; the
&quot;a&quot; in the caller's scope already exists before the call, and
the &quot;a&quot; passed as an argument is created at the module call as
attributes.a and is NOT the same variable as caller.a .&nbsp; After the
call you would have the following:<br>
<br>
Caller
scope<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>mytab's
scope<br>
----------------<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>-------------------<br>
variables.a<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>attributes.a
( = local variable with same value as caller.a)<br>
variables.c<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>attributes.b
( = local variable with same value as caller.c)<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>caller.a
( = the caller's variables.a)<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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!&nbsp; <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
&quot;attributes.message&quot; will be strictly local to that invocation
of the tag.&nbsp; 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>
&gt;&gt;&gt; [EMAIL PROTECTED] 08/21/00 04:53PM &gt;&gt;&gt;<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>
&nbsp; -- 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,&nbsp; <br>
<br>
I'm working on my very first custom tag.&nbsp; 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.&nbsp; 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.&nbsp; 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.&nbsp; There must be more to
&quot;caller.variable&quot; than meets the<br>
eye.&nbsp; What happens in the calling page is that &quot;message&quot;
has the name of the<br>
last component of the outer structure.<br>
<br>
Can anyone tell me what I am missing?&nbsp; Thanks very much.&nbsp; (And
I hope the<br>
recursion doesn't give anyone a headache!)<br>
<br>
&lt;!--- CF_output_unknown [input] test_object [output] message&nbsp;
-&gt;<br>
<br>
&lt;cfif IsDefined(&quot;attributes.test_object&quot;) IS
&quot;No&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;cfset
#caller.message# = &quot;&quot;&gt;<br>
&lt;cfelseif #IsSimpleValue(attributes.test_object)#&gt;<br>
&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;cfoutput&gt;#attributes.test_object#&lt;/cfoutput&gt;
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;cfset
#caller.message# = #attributes.message# &amp;<br>
#attributes.test_object#&gt;<br>
&lt;cfelseif #IsStruct(attributes.test_object)#&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOOP
COLLECTION=#attributes.test_object# item=&quot;struct&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;cfset
#caller.message# = #attributes.message# &amp; #struct# &amp;<br>
&quot; = &quot;&gt;<br>
&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;cfoutput&gt;&lt;BR&gt;#struct#
= &lt;/cfoutput&gt; <br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CF_output_unknown<br>
test_object=#attributes.test_object[struct]#
message=#attributes.message#&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/CFLOOP&gt;<br>
&lt;cfelseif #IsArray(attributes.test_object)#&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CFLOOP
index=i from=1 to= #arrayLen(attributes.test_object)#&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;CF_output_unknown
test_object=#attributes.test_object[i]#<br>
message= #attributes.message#&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/cfloop&gt;<br>
&lt;cfelse&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;Cfset
#caller.message# = #attributes.message# &amp; &quot;Unable to
proceed<br>
with CF_output_unknown.&quot;&gt;<br>
&lt;/cfif&gt;<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&amp;body=lists/cf_talk" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;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&amp;body=lists/cf_talk" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebar=lists&amp;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&amp;bodysts/cf_talk" 
eudora="autourl">http://www.houseoffusion.com/index.cfm?sidebarsts&amp;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.

Reply via email to