Ah, I must retract my statement. I misread the results of a test I did. All I really wanted to point out was the value of argumentcollection as another means to pass in data. Though I'd never considered passing in a structure with any keys other than the expected arguments, Todd's comments about the way regularly passed parms can change based on order/match made me think to try it with a structure.
 
Alas, the code I tested misled me to conclude wrong about what would happen if the keys in the structure didn't match the order of the CFARGUMENTs. It appears that with this approach, they must match.
 
Indeed, I tried passing in 3 keys with only 2 CFARGUMENTs and then trying to make reference to the third with arguments[3], and that didn't work (though it would work if passed in either named arguments or positional arguments (the other two ways Todd had listed).
 
I've been meaning to write up an article, "How can I call a method, let me count the ways", because when you factor in CFINVOKE, CFOBJECT, and CREATEOBJECT, not to mention simple calls to CFFUNCTIONs as UDFs; and then consider named arguments, positional arguments, the argumentcollection; and then consider referring to them in the method by name or by the arguments array....well, it's all quite flexible!
 
/charlie
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Nathan Dintenfass
Sent: Tuesday, March 18, 2003 5:55 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Calling functions with parameters

Charlie:

Can you explain what you mean by:
 
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. 
 
Are you saying that the keys in the structure used as the value of the ARGUMENTCOLLECTION need to be in a certain order if the keys in that structure aren't the names of the CFARGUMENTs in the function being called?  If that's what you meant, are you sure that's true?
 
 
 

Reply via email to