You can actually use the session key in your argumentCollection: methodName( argumentCollection = session.NODA09_formStruct )
Enjoy! Francois Levesque http://blog.critical-web.com/ On Wed, Dec 31, 2008 at 10:37 AM, Scott Stewart <saste...@email.unc.edu>wrote: > Here's a little more background > This creates structure keys and populates them in the session scope > > session.NODA09_formStruct=StructNew(); > > For (i=1;i LTE Form.PE_Counter; i=i+1) > > if(StructKeyExists(FORM,'play_'&i)){ > session.NODA09_formStruct['play_'&i] = form['play_'&i]; > > } > > because there's a intermediate step before any database writes happen. > So in the function that does the insert > I have to loop over the structure to find the dynamic variables ('play_' > &i) and populate argument variables ('arguments.play_' &i ?) > > > Andy Matthews wrote: > > 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:saste...@email.unc.edu] > > 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: saste...@email.unc.edu > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:317294 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4