>
>
>
> -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, only parameters at the end can be
> left off. Ho
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 param
On Wed, 1 Dec 2004 10:20:27 +1100, Paul Wilson <[EMAIL PROTECTED]> wrote:
> do this
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 structKeyExists(arguments,'a
Another option is to use the argumentCollection, i.e.
obj.method( argumentCollection = structureContainingAllRequiredArguments )
Example:
variables.argumentCollection = structNew();
variables.argumentCollection.argument1 = form.argument1;
variables.argumentCollection.argument2 = url.argument2;
va
Another alternative is to use named arguments.
assuming your function is defined as:
On Wed, 1 Dec 2004 10:20:27 +1100, Paul Wilson wrote:
>
>
>>>
>>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 o
By named parameters.
Offcourse the argument name has to match the name in the method.
> do this
> Firstly is it a good idea to do this in a CFC?
Not sure what to answer here, I know in OOP it's a bad thing to have
switches and if's in a method.
Maybe your better off creating another method?
I
If you use positional parameters, only parameters at the end can be
left off. However, you can use named parameters without using
CFINVOKE:
I generally prefer to not specify a default for my option arguments,
and then use structKeyExists() against the 'arguments' struct to check
if they were pa
On Wed, 1 Dec 2004 10:20:27 +1100, Paul Wilson wrote:
>
> 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 list the required arguments first an
8 matches
Mail list logo