You've got three options to pass arguments into a method.
Specific placement: methodName('andy',42)
Arguments must be in the slot in which they're defined in the method.
Named arguments: methodName(name='andy',id=42)
Arguments can be passed in any arrangement you like
Argument collection: args.name = 'andy; args.id = 42; methodName(args);
Create a struct with a key named after each of your arguments, pass in the
struct
andy
-----Original Message-----
From: Scott Stewart [mailto:[email protected]]
Sent: Wednesday, December 31, 2008 9:19 AM
To: cf-talk
Subject: ColdFusion Components: Setting dynamic arguments dynamically
Confused programmer is confused (just because the title sounds like
LOLSpeak)
I've got this little piece of code that dynamically creates and populates a
structure key pair, based on what's sent from a form with a dynamically
generated set of fields (javascript "add row")
For (i=1;i LTE Form.PE_Counter; i=i+1)
if(StructKeyExists(FORM,'play_'&i)){
session.NODA09_formStruct['play_'&i] = form['play_'&i];
}
I know that the arguments in a cf function are very particular about their
placement, can I use similar code to create and populate arguments?
--
Scott Stewart
ColdFusion Developer
Office of Research Information Systems
Research & Economic Development
University of North Carolina at Chapel Hill
Phone:(919)843-2408
Fax: (919)962-3600
Email: [email protected]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317292
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4