On 10/16/06, Dave Hoff <[EMAIL PROTECTED]> wrote: > Thanks Rob. I'll try and paste the entire code below. > ------------------------------------------------ > for(i=1; i LTE getTopLevel.recordset.recordcount; i=i+1) > { > tempName = getTopLevel.recordset.name[i]; > tempCFC = "gateway.imified.apps." & getTopLevel.recordset.cfc_name[i]; > tempMethod = getTopLevel.recordset.entry_method[i]; > tempService = getTopLevel.recordset.Id[i]; > tempVar = "session.M" & i; > > > if(getTopLevel.recordset.cfc_name NEQ "") > #tempVar# = session.root.addChild(name="#tempName#", key="#i#"); > else > #tempVar# = session.root.addChild(name="#tempName#", key="#i#", > cfc="gateway.imified.apps.#tempCFC#", method="#tempMethod#"); > > // Get children > SQLString = "select * from methods where service_id = " & tempService & " > order by sort_order asc"; > DATASOURCE = request.dsn; > getChildren = query(sql=SQLString, datasource=DATASOURCE); > > for(j=1; j LTE getChildren.recordset.recordcount; j=j+1) > { > childName = getChildren.recordset.method_name[i]; > childCFC = "gateway.imified.apps." & getChildren.recordset.cfc_name[i]; > childMethod = getChildren.recordset.entry_method[i]; > childVar = "session.m" & i & "_" & j; > > #childVar# = #tempVar#.addChild(name="#childName#", key="#j#", > cfc="#childCFC#", method="#childMethod#"); > } > } > --------------------------------------------------------- > > CF throws the following error: > Invalid CFML construct found on line 122 at column 95. ColdFusion was looking > at the following text:<p>.</p><p>The CFML compiler was processing:<ul><li>a > script statement beginning with ""#"" on line 122, column 73. > > Looks like it has a problem with: > #childVar# = #tempVar#.addChild(name="#childName#", key="#j#", > cfc="#childCFC#", method="#childMethod#"); > > Temp var is causing the trouble. Does the code above (as messy as it is) look > like it should work? > > Thanks. > > >On 10/16/06, Dave Hoff <[EMAIL PROTECTED]> wrote: > > > >What error is thrown? For readability (and maybe functionality), try: > > > >childVar = session['M' & i & '_' & j]; > >tempVar = session['M' & i]; > > > >Or, just do it all at once: > > > >session['M' & i & '_' & j] = session['M' & i].addChild ( ... );
I'm not sure. The dynamic variable evaluation looks funky. Try: "#childVar#" = "#tempVar#".addChild(name="#childName#", key="#j#", cfc="#childCFC#", method="#childMethod#"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256923 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4