> Cold Fusion is weak in these areas, but really you can do 
> all these things (or "emulate" them :-) ) using existing 
> features. (forgive my syntax - I'm writing this quickly)
> 
> Pick a standard variable name, like ReturnValue and only use 
> it for returning a value from a custom tag:
>        caller.ReturnValue = xxx
> 
> Or use the tag's name as a structure:
>         If NOT IsDefine("MyTagName") {
>                MyTagName = StructNew()
>                }
>        MyTagName.Return = "some data"

If I might suggest a better alternative, you can make the user of the custom
tag responsible for naming the return variable (which is the norm in most
languages) by creating an attribute of the custom tag for that name, and
using the SetVariable function within the custom tag to create that variable
dynamically:

<!--- custom tag call --->
<cf_foo return="foovar">
<cfoutput>#foovar#</cfoutput>

...

<!--- custom tag contents --->
<cfparam name="Attributes.Return" default="Return">
<cfset myvalue = "42">
<cfset rs = SetVariable("Caller." & Attributes.Return, myvalue)>

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
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