use associative array notation: <cfset variables['varMergerFile' & i] = "c:\inetpub\uploads\pdf\resume_#i#.pdf">
Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ On 24/09/2009 04:44, Dakota Burns wrote: > I have the following code below (codeblock 01), which outputs the following > three lines correctly: > CFSET varMergeFile1 = "c:\inetpub\uploads\pdf\resume_1.pdf" > CFSET varMergeFile2 = "c:\inetpub\uploads\pdf\resume_2.pdf" > CFSET varMergeFile3 = "c:\inetpub\uploads\pdf\resume_3.pdf" > > [CODEBLOCK 01: BEGIN] > <!--- GET LIST LENGTH ---> > <cfset printIt = "1212,1549,2003"> > <cfset listLength = ListLen("#printIt#")> > <!--- DISPLAY EVERY ELEMENT IN LIST ---> > <cfset x = 1> > <cfloop index="i" from="#x#" to="#listLength#" step="1"> > <cfoutput>CFSET varMergeFile#i# = > "c:\inetpub\uploads\pdf\resume_#i#.pdf"</cfoutput><br /> > </cfloop> > [CODEBLOCK 01: END] > > When I activate the cfset tag with angle brackets: <CFSET varMergeFile#i# = > "c:\inetpub\uploads\pdf\resume_#i#.pdf">, I get this error: "Invalid CFML > construct found on line 11 at column 38. ColdFusion was looking at the > following text: #" > > I then wrap double quotes around "varMergeFile#i#", and receive no error, > but the file I'm outputting is invalid and I believe that variable is not > being defined correctly. > > Is their another way to write the above where varMergeFile#i# is not > required to be wrapped by double quotes? > > Thanks, > Dakota > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326560 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4