Interestingly, using cfinvoke/cfinvokeargument names the arguments. So
in the function itself, you could access the arguments either via the
names, or the array they are in. However, it seems the array is
alphabetized, and not in the order you call them in.
Here is some sample code.
***********The CFC, save as testArgs.cfc
<cfcomponent output="false">
<cffunction name="functionOne">
<cfdump var="#arguments#" label="functionOne dump">
<cfloop from="1" to="#arrayLen(arguments)#" index="i">
<cfoutput>#arguments[i]#<br/></cfoutput>
</cfloop>
</cffunction>
</cfcomponent>
**********The CFM, save as whatever you like and call it in a browser.
<cfinvoke component="testArgs" method="functionOne">
<cfinvokeargument name="argA" value="something">
<cfinvokeargument name="argB" value="or another">
<cfinvokeargument name="argC" value="foo bar">
</cfinvoke>
********
To see what I mean about the alphabetical deal, change the name of
argB to argAA and see that its value is displayed first.
On 10/22/07, Baz <[EMAIL PROTECTED]> wrote:
> Hey Matt, what would the syntax be using cfinvoke?
>
> Baz
>
>
> On 10/22/07, Matt Williams <[EMAIL PROTECTED]> wrote:
> >
> > It is possible, as I just learned. You should be able to pass as many
> > arguments as you like and reference them as arguments.1 (or
> > arguments[1]).
> >
> > http://groups.google.com/group/cfcdev/t/f814dbd6c276ef7
> >
> >
> > On 10/22/07, Baz < [EMAIL PROTECTED]> wrote:
> > > Hi gang,
> > >
> > > I was wondering if it were possible to pass an un-named argument to a
> > > dynamic function. For example, I have this call:
> > >
> > > <cfinvoke method="get#arguments.Name#" returnvariable="ReturnValue"
> > > value="#arguments.Value#" /> - It is a CFINVOKE because to my knowledge,
> in
> > > CF8, you still can't invoke a dynamic function using script, i.e.
> > > set#DynamicFunction#(arguments) The attribute "value" in the cfinvoke
> call
> > > basically passes the invoked function an argument named "Value". Is it
> > > possible to pass in an un-named argument in position 1 instead?
> Basically
> > > the equivalent of set#DynamicFunction#(Value)??
> > >
> > > Cheers,
> > > Baz
> > >
> > >
> > >
> > > >
> > >
> >
> >
> > --
> > Matt Williams
> > "It's the question that drives us."
> >
> > > >
> >
>
--
Matt Williams
"It's the question that drives us."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---