Hi all,
Is there a way to explicitly pass in undefined to a function for an
argument?
For example, a function:
<cffunction name="getNumArgs" returntype="boolean">
<cfargument name="a" type="numeric" required="no">
<cfargument name="b" type="numeric" required="no">
<cfargument name="c" type="numeric" required="no">
<cfset numArgs = 0>
<cfif isDefined("ARGUMENTS.a")><cfset numArgs=numArgs+1></cfif>
<cfif isDefined("ARGUMENTS.b")><cfset numArgs=numArgs+1></cfif>
<cfif isDefined("ARGUMENTS.c")><cfset numArgs=numArgs+1></cfif>
<cfreturn numArgs>
</cffunction>
The function call:
I know you can do this:
<cfset result = getNumArgs(a=1,c=1)>
But can you do something like this:
<cfset result = getNumArgs(1,undefined,1)>
Where undefined is replaced with some value? I don't want to have to
rewrite the function to look for a string "undefined" or anything like that.
Thanks!
Nat
- - - - - - - - - - - - - - - - - -
Nat Dunn
Webucator
4933 Jamesville Rd
Jamesville, NY 13078-9428
<http://www.webucator.com/> http://www.webucator.com
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
877-WEBUCATE (877-932-8228) x221
315-446-0560 x221 (local)
315-410-5320 (fax)
- - - - - - - - - - - - - - - - - -
________________________________________________________________
To unsubscribe: send a message to [EMAIL PROTECTED] with
'Unsubscribe CFUGCNY' in the body.
To send a message to the list: [email protected]
List archives: http://www.mail-archive.com/[email protected]/index.html
Visit our website: http://www.cfugcny.org