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 arguments out of order when using 
named arguments, or even if it's good practice to use named arguments at 
all is another question, but it's just a stylistic one IMO.

Spike

Scott Brady wrote:
> 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 list the required arguments first and then the
> optional ones, primarily so I can use the obj.testmethod() syntax. 
> So, I'd suggest re-arranging the order of the arguments in your CFC. 
> This may require altering the calls to that method in other pages, of
> course.
> 
> Scott
> 

-- 

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185759
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to