I'm pretty sure you can do cfset var myVariable = 1 in cfmx as well

- Calvin

-----Original Message-----
From:  Philip Arnold
Date:  6/11/04 9:49 am
To:  CF-Talk
Subj:  Re: Dumb UDF quesiton with local variables

On Fri, 11 Jun 2004 09:45:38 -0400, C. Hatton Humphrey wrote:
>
> > Yep, to localize a variable, just use the var scope:
>
> Okay, I'm confused even more now... I thought that UDF's in CF5 were done
> inside of CFScript and in MX are done using CFFunction - that's how I've
> been doing it.

MX can do both - the only reason to do one in CFFunction is if you're
using CF tags rather than just script

> Here's the UDF that was causing the problem -
>
> <cffunction name="SetDefaultValues" returntype="query" access="private"
> output="false">
>        <cfargument name="UseDate" required="yes">
>        <cfset DateStart = CreateDate(Year(UseDate), Month(UseDate), 1)>
>        <cfset NumDays = DaysInMonth(DateStart)>
>        <cfset qDefaultPlan = QueryNew("id,dEntry,Hours,Downtime,Rate")>

Use a CFSCRIPT block at the top and Var the variables to make them
local, otherwise you're using the Variables. scope versions
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to