> I didn't want to use a trimmed caller variable, as doing so is three
> times more complicated than just getting the results via the custom
> tag itself. Fine for me, but I intend this to be used by others in my
> company, and the simpler the usage the better.
>
> So, I can use:
> <cf_MyCustomTag>
>
> Instead of :
> <cf_MyCustomTag>
> <cfoutput>#trim(myCallerVariable)#</cfoutput>
>
> See the value in this?
No. If you don't want white space around the returned string then there's
no reason it should be returned by the custom tag! Trim it within the tag.
Also, for maximum flexibility (and safety) you should pass in the name of
the caller variable, rather than using a predetermined name.
<cf_MyCustomTag inputstuff="48" variable="myVariable">
<cfoutput>#myVariable#</cfoutput>
Your custom tag then does something like:
<cfparam name="variable">
<!---
processing to arrive at a value within the internal variable
called 'returnvalue' ...
--->
<cfset temp = SetVariable("caller.#attributes.variable#",
Trim(returnvalue))>
Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists