Barney,
I'm curious - why do you prefer structKeyExists() vs. setting
default values?
Walt
-Original Message-
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 30, 2004 6:26 PM
To: CF-Talk
Subject: Re: CFC required arguments
If you use positional parameters
Subject: Re: CFC required arguments
If you use positional parameters, only parameters at the end can be
left off. However, you can use named parameters without using
CFINVOKE:
cfset o.method(name=url.name, age=url.age, ...) /
I generally prefer to not specify a default for my option
I'm using createObject to invoke a CFC and one of the methods in the CFC
takes a number of arguments, all numeric but not all required. In the
CFC I have some conditional statements that do various things based on
the arguments passed in.
cfif arguments.arg neq do this/cfif
Firstly is it a good
On Wed, 1 Dec 2004 10:20:27 +1100, Paul Wilson wrote:
cfset result = obj.testmethod(0,1, ,10)
The third argument is not required but this will throw an error. This
situation doesn't arise when you use cfinvoke as you can simply miss out
the cfinvokeargument tag.
Generally in the CFC, I
If you use positional parameters, only parameters at the end can be
left off. However, you can use named parameters without using
CFINVOKE:
cfset o.method(name=url.name, age=url.age, ...) /
I generally prefer to not specify a default for my option arguments,
and then use structKeyExists()
PROTECTED]
Sent: Wednesday, 1 December 2004 9:20 AM
To: CF-Talk
Subject: CFC required arguments
I'm using createObject to invoke a CFC and one of the methods in the CFC
takes a number of arguments, all numeric but not all required. In the CFC I
have some conditional statements that do various things
Another alternative is to use named arguments.
cfset result = obj.testmethod(foo=0,bounce=1,boing=10)
assuming your function is defined as:
cffunction ...
cfargument name=foo...
cfargument name=bar...
cfargument name=boing...
cfargument name=bounce...
Whether it's good practice to call
://www.webassociates.com
-Original Message-
From: Paul Wilson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 December 2004 9:20 AM
To: CF-Talk
Subject: CFC required arguments
I'm using createObject to invoke a CFC and one of the methods in the CFC
takes a number of arguments, all numeric but not all required
On Wed, 1 Dec 2004 10:20:27 +1100, Paul Wilson [EMAIL PROTECTED] wrote:
cfif arguments.arg neq do this/cfif
If they are numeric arguments, you shouldn't have an empty string as
the default.
As other have hinted, specify required=false but do not specify a
default= value.
Then you can test
9 matches
Mail list logo