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;
variables.argumentCollection.argument3 = variables.argument3;

obj.method( argumentCollection = variables.argumentCollection )

Off course if all arguments were in the form scope you could do
obj.method( argumentCollection = form )

-- 
Taco Fleur
Senior Web Systems Engineer
http://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. 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 idea to do this in a CFC? And secondly, how can I pass
is the only the arguments required .e.g.

<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.

Thanks





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185761
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