views:

565

answers:

1

Normally you create a function using cfscript like:

<cfscript>
    function foo() { return "bar"; }
</cfscript>

Is there a way to declare this as a private function, available only to other methods inside the same cfc?

I know you can do it with tags:

<cffunction name="foo" access="private">
    <cfreturn "bar">
</cffunction>

But I don't want to have to rewrite this large function thats already written in cfscript.

+8  A: 

Nope. There is speculation it might be added with CF9, but that's a fair way off.

You don't need to rewrite the whole function, you can do this:

<cffunction name="foo" returntype="string" output="false" access="private">
    <cfscript>
     return "bar";
    </cfscript>
</cffunction>
Peter Boughton