You can use CFFUNCTION in MX:

<CFFUNCTION NAME="myFunction" RETURNTYPE="numeric">
     <CFARGUMENT NAME="some_passed_var" TYPE="numeric">
     <CFSET pv = Arguments.some_passed_var>
     <CFSET pv = Val(pv + 10)>
     <CFRETURN pv>
</CFFUNCTION>

-Dain

Daniel Kessler wrote:
> <
>
> I have a set of code in CF that I use four times in a script.  It
> could easily be a function with an in/out but I've yet to see
> functions in CF, mostly scripts.  I don't want to do anything special
> by making it external or making it nice enough to give to others.  I
> just want a callable/reusable function:
>
> function myFunction(some_passed_var){
> <cfset pv = some_passed_var>
> <cfset pv = pv+10>
> return pv
> }
>
> Is there something similar in CF?
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to