And don't forget you can use argumentcollection as well, if it ever makes sense to arrange the complex set of input arguments as a structure first, as in:
 
<cfset parms=structnew()>
<cfset parms.param1=value1>
<cfset parms.param2=value2>
<cfset parms.param3=value3>
<cfset temp = application.db.get_info(argumentcollection=parms)>
 
Of course, you could do all that in a CFSCRIPT as well for those who prefer that format. As with the variants below, if the structure keys do not match the names of the cfarguments, then they must be in order as expected by them. If they do match the names, then they don't need to match the order.
 
/charlie
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Todd
Sent: Tuesday, March 18, 2003 3:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Calling functions with parameters


Two ways:
<cfset temp = application.db.get_info(param1,param2,param3)> <-- you just wrote this one and it's valid, but you have to pass it in the same order in which the <cfargument> is being declared.  So, if your first param is looking for a numeric and you're passing in a name, it's going to fail.

<cfset temp = application.db.get_info(param1=value1,param2=value2,stuff=value3)> <-- another way to pass in params and values, but this does not require the cfargument to be in any particular order.

~Todd

At 01:47 PM 3/18/2003 -0600, you wrote:

If I have a function in a cfc that requires 3 parameters, how can I call that using this format?

<cfset temp = application.db.get_info(param1,param2,param3)>

Is there any way to specify what parameter name is?

Thanks
Marlon



Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/
Team Macromedia Volunteer for ColdFusion
http://www.macromedia.com/support/forums/team_macromedia/
http://www.devmx.com/

Reply via email to