Another great reason for CFMX6.1, vars still need to be at the top but they can now be inside a CFSCRIPT block.
----------------- <cffunction name="getFoo"> <cfargument name="who" default="me"> <cfscript> var name = ""; name = "mike"; </cfscript> <cfreturn name> </cffunction> <cfoutput>#getFoo()#</cfoutput> ---------------- ----nimer -----Original Message----- From: Massimo Foti [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 10:55 AM To: CF-Talk Subject: Re: UDF in CFC's - was: CFC Issues.... > >> <cfscript> > >> function boring() { return now(); } > >> </cfscript> > > wow!.. I didn't know you could do that. > > Why would anyone want to? > > You can't set the access type, you can't specify the return type, you > can't specify any argument types. <cffunction> offers a lot of benefits, but many still like a lot the scripting syntax. I gave up on <script> for UDFs for the reasons you listed above, but I go back to <cfscript> pretty often > You can still use <cfscript> for the *body* of all your functions > (after the <cfset> tags for your 'var' scope local variables!). What drives me crazy is that the compiler doesn't let me declare all the 'var' scope local variables in a single <cfscript> tag after the opening <cffunction>... ---------------------------- Massimo Foti Certified Dreamweaver MX Developer Certified Advanced ColdFusion MX Developer http://www.massimocorner.com/ ---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com