Hamoud, Ryan N. said the following on 3/10/2006 11:28 AM:
So var scoping has to be done at the top of methods right?
So how do var scope for a situation when you don't actually cfset the variable till the end of your method.
The only reason I came across this is when I was validating all my arguments at the top and then near the bottom I finally set my variable that I wanted to retune.
<cfset var someVar = "" />
 
Here is a example of what I am referring to.
 
<CFFUNCTION NAME="tableSearch" access="remote" returntype="string">
  <CFARGUMENT NAME="searchFor" type="string" required="yes">
  <CFARGUMENT NAME="tableName" type="string" required="yes">
  <CFARGUMENT NAME="fieldToSearch" type="string" required="yes">
  <CFARGUMENT NAME="returnField" type="string" required="yes">
  <CFARGUMENT NAME="searchFieldType" type="string" required="yes">
None of your cfaborts you have defined will be thrown because you have the required attribute set to yes in your cfarguments.  CF will throw an error if one or more of your arguments are not passed.
-- 
Peter J. Farrell :: Maestro Publishing
Member Team Mach-II :: Member Team Fusion
http://blog.maestropublishing.com

Create boilerplate beans and transfer objects for ColdFusion!
Fire up a cup of Rooibos!
http://rooibos.maestropublishing.com/

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to