RE: CFC required arguments

2004-12-01 Thread Sparrow-Hood, Walter
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

Re: CFC required arguments

2004-12-01 Thread Barney Boisvert
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

CFC required arguments

2004-11-30 Thread Paul Wilson
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

Re: CFC required arguments

2004-11-30 Thread Scott Brady
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

Re: CFC required arguments

2004-11-30 Thread Barney Boisvert
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()

RE: CFC required arguments

2004-11-30 Thread Taco Fleur
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

Re: CFC required arguments

2004-11-30 Thread Spike
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

RE: CFC required arguments

2004-11-30 Thread Taco Fleur
://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

Re: CFC required arguments

2004-11-30 Thread Sean Corfield
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