Hehe, apparently I'm replying to this message in stages... I've been
playing with this.
So... according to the cf documentation, all args specified in the
function declaration are mandatory. It seems that the only way to use
optional arguments in cfscript function arguments is to use a try
block like I did. I finally settled for this:
test.cfc
------------------------------
<cfcomponent>
<cfscript>
function getCGI(cV) {
try {
var cVlocal = cgi[cV];
}
catch (any localErrorVar) {
var cVlocal = cgi;
}
return cVlocal;
}
</cfscript>
</cfcomponent>
Same code as before in the calling page, though, and the cfdumps both work fine.
Laterz,
J
On Wed, 2 Mar 2005 14:56:18 -0700, Paul <[EMAIL PROTECTED]> wrote:
> This must be easier than I'm making it this afternoon.
>
> All the UDFs from cflib.org are written in cfscript. Is there a way to
> store them in a CFC, say Util.cfc, and then call them from another CFC?
> When I attempt to do so CF can't find the function. I experimented and
> wrapped the cfscript inside a cffunction definition and now CF apparently
> can't see the arguments I'm passing in.
>
> So, how does one call cfscript-based functions from within a CFC?
>
> -paul
>
>
> http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=15114.13525.4
> Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
>
--
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com
http://cfobjective.neo.servequake.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197227
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54