Doug,
There are a couple of ways to handle this. If all you're doing is setting a
variable, then you can do any of the following:
<!--// the syntactically correct way //-->
<CFSET tmpVar = SetVariable(name, value)>
<!--// a more efficient method of the above example //-->
<CFSET SetVariable(name, value)>
<!--// undocument, but works now, but could be unsupported in the future
//-->
<CFSET "#name#" = value>
If you actually need to execute code, then you'll need to save the code to a
temp file, include that code, then delete the included file.
-Dan
+--------+---------------------------+
| name | Dan G. Switzer, II |
|company | PengoWorks.com |
| www | http://www.pengoworks.com |
| mailto | [EMAIL PROTECTED] |
+--------+---------------------------+
-----Original Message-----
From: Doug Nottage [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 27, 2000 11:21 PM
To: '[EMAIL PROTECTED]'
Subject: Executing a String?
How can I assemble an CFML command inside a string and execute it?
For example, If I had the following CFML code, what would be the next line
to actually cause the variable "somevalue" to be created and assigned a
value of 3?
<cfset myString = "<CFSET somevalue=3>">
I have a table with two columns called "variableName" and "variableValue".
I'd like to loop through the set and make sure all the variables get their
assigned values.
I could have sworn I made this happen before, but I just can't seem to
remember how. I've tried the #evaluate()# function, but you can't do
something like <CFSET #evaluate("variableName")# =
#evaluate("variableValue")#> because the left side of an equation can't be a
function, according to the CF rules.
Any ideas???
--Doug
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.