Obviously, your function names must be unique per CFM, so the unique
name for all functions is a concatenation of the CFM name and the
function name. Here is a quick UDF (read not tested) that does what you
need.
<cfscript>
function unique(fileName, functionName) {
var theName = fileName & ":" & functionName;
return theName.hashCode();
}
</cfscript>
You might also be interested in the following Java class I created,
which creates unique class names for CFMs just like CFMX does:
http://devilm.com/archives/000001.html.
-Matt
On Tuesday, August 19, 2003, at 02:51 PM, Tim Blair wrote:
>> Yes that is what I meant, why not use the name of the
>> function as the key instead of hashing it?
>
> Ah right.
>
> Can't do that because there may well be multiple functions with the
> same
> name (defined in templates that don't run at the same time obviously),
> hence I need some value for a key which uniquely identifies any
> function, regardless of name.
>
> Tim.
>
>
> -------------------------------------------------------
> RAWNET LTD - Internet, New Media and ebusiness Gurus.
> Visit our new website at http://www.rawnet.com for
> more information about our company, or call us free
> anytime on 0800 294 24 24.
> -------------------------------------------------------
> Tim Blair
> Web Application Engineer, Rawnet Limited
> Direct Phone : +44 (0) 1344 393 441
> Switchboard : +44 (0) 1344 393 040
> -------------------------------------------------------
> This message may contain information which is legally
> privileged and/or confidential. If you are not the
> intended recipient, you are hereby notified that any
> unauthorised disclosure, copying, distribution or use
> of this information is strictly prohibited. Such
> notification notwithstanding, any comments, opinions,
> information or conclusions expressed in this message
> are those of the originator, not of rawnet limited,
> unless otherwise explicitly and independently indicated
> by an authorised representative of rawnet limited.
> -------------------------------------------------------
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Get the mailserver that powers this list at
http://www.coolfusion.com