My Googling skills suck, and I’m new to CF. I would’ve posted this elsewhere, but my news server won’t subscribe to macromedia.* newsgroups :(, and using Google Groups takes fooooorever–I’d like to know by the end of today.
But, how would I refer to a variable within a variable? e.g…
<cfquery name=“myQuery”> select #myField# from aTable </cfquery>
<cfoutput query=“myQuery”>
<! – this is the part I’m having trouble with, how do I refer to the SQL values within #myField# … e.g., a variable within a variable like #(#myField#)# -->
I didn’t mean to come across as biting your head off… I wasn’t being negative/snippy/anything… Just trying to clarify the best I could, but I couldn’t think of a better example than the function I wrote in the OP… It is somewhat difficult to explain, and difficult to Google as a result.
for the record whilst you can use evaluate for other “variable within a variable” scenarios (form, url, session etc.) in Coldfusion MX and above, it is generally recommended that whenever possible you work within scopes as its quicker/cleaner. So, for example, if you were doing the same thing as above but with a form you’d use:
#form["#myField#"]#
rather than:
#evaluate(“form.#myField#”)#
anyway,
any other problems/questions either post them here or feel free to drop me a mail.