wrap the variable name in quotes: <cfset "myvar_#somecfvar#" = "#some_value#">
Darin Kohles, Application Developer [EMAIL PROTECTED] Digital Positions, Inc. 2289 Peachtree Road NE Atlanta, GA 30309 404-351-8878 support phone 404-351-2366 main phone 404-351-4055 fax http://www.d-p.com/ ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Howard Sent: Monday, June 11, 2007 4:43 PM To: discussion@acfug.org Subject: [ACFUG Discuss] building a variable's name dynamically Hey all, This may be something perfectly obvious that I'm overlooking but I'm trying to initialize a variable while building the variable name dynamically based on a loop. My code is as follows : <CFOUTPUT query="qryGetproj_names"> <CFSET customer_po#qryGetproj_names.CURRENTROW#="#customer_po#"> </CFOUTPUT> Unfortunately, CF doesn't like this code and is thrwoing this error: Invalid CFML construct found on line 39 at column 25. ColdFusion was looking at the following text: # The CFML compiler was processing: * a CFSET tag beginning on line 39, column 8. * a CFSET tag beginning on line 39, column 8. The error occurred in C:\Inetpub\wwwroot\accting_db\project_request.cfm: line 39 37 : <br /><CFDUMP var="#qryGetproj_names#"> 38 : <CFOUTPUT query="qryGetproj_names">#qryGetproj_names.CURRENTROW#---customer_po#qry Getproj_names.CURRENTROW#<BR /> 39 : <CFSET customer_po#qryGetproj_names.CURRENTROW#="#customer_po#"> Could someone please point out where my error is? I'm trying to populate a form with the existing values in the DB and there are 16 lines/rows in the form that are each an individual record in the DB. ------------------------------------------------------------- Annual Sponsor - Figleaf Software <http://www.figleaf.com> To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink <http://www.fusionlink.com> ------------------------------------------------------------- ------------------------------------------------------------- Annual Sponsor FigLeaf Software - http://www.figleaf.com To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------