> 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.

OK, running CF commands from a variable just won't happen - CF needs to
interpret the code from a file, so either write it to a file or use the
proper variable setting routines;

> <CFSET #evaluate("variableName")# = #evaluate("variableValue")#>

If you want to do this, then;
<cfset "#VariableName#"=Evaluate(VariableName)>

Philip Arnold
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


------------------------------------------------------------------------------
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.

Reply via email to