Chad,
Inside your custom tag, you can use the CALLER scope to access any local
variable in the calling page. So yes, if you want to maintain a set of
variables across multiple custom tag calls, just access them as
CALLER.variable within each tag. But this method makes the tag lose
generality because you need to hard-code within the tag the names of
variables that are used in the calling page. Which is why passing
variables into a tag through the ATTRIBUTE scope is usually preferred.

If you want to maintain a set of variables that persist across
different/multiple custom tags, you can also define them as "universal"
variables such as SESSION or REQUEST - these will be visible through
any and all custom tag calls.

You should be able to pass any CF data structure through the CALLER or ATTRIBUTE scope, including structures and arrays. What is your particular issue with arrays?


Chad Renando wrote:
Hey all.  I am still hacking my way through the custom tag thing, and
was wondering if someone could shed some light on the whole caller and
attribute scopes.

I have some nifty recursion going on in my custom tags.  Do I need to
scope my variables as caller in order to maintain them through each
iteration of the tag?  Specific areas where I have run into issues are
in the creation of arrays.

Is there any issue if I just declare everything as caller, if I am
careful with my naming conventions?  If I set something as a caller,
can I then access it using the variable scope outside of the tag?

Cheers,

Chad
who is considering scoping his food as breakfast.eggs, lunch.fries and
dinner.potatoes



--
Regards: Ayudh

+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+



---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to