Ask a Question related to Macromedia ColdFusion, Design and Development.
-
perezle #1
Avoiding Evaluate
I'm starting with a formula, which is a string, in a variable. For example,
calcFormula = (a + b) / c. I replace parts of the string with numeric values
so that I end up with calcFormula's value being something like this: (2 + 4) / 2
I need to calculate the value of calcFormula now. Is there another way to do
this besides the below?
calcValue = Evaluate("#calcFormula#")
perezle Guest
-
Evaluate my site...
I posted this in DHTML so I didn't get a million responses. Check out http://www.viswiz.biz/simacor/simacor.html I am not looking for design... -
evaluate string
Hi I hve a list mylist= I am inserting the values dynamically in the string format in the list and the list becomes mylist=] or mylist=] now... -
Cookie & evaluate
Hi All, Heres my problem... This snippet of code: <cfif isDefined('#evaluate('COOKIE.poll' & FORM.pollID)#')> is causing this error: Variable... -
PreserveSingleQuotes and Evaluate
Hi all. I've run into a bit of a problem with part of an application. I have users inputting , what can be, multiple animal (Species) names and... -
Please evaluate my Project
For my MSc in Multimedia project I am developing a 3D surgery simulation centre for othtopaedic surgeons and physiotherapists. I have developed a... -
OldCFer #2
Re: Avoiding Evaluate
Normally you would just set the a, b, and c values, then use:
<cfset calcValue = (a + b) / c>
OldCFer Guest
-
perezle #3
Re: Avoiding Evaluate
I don't know the structure of the formula until the page loads, so I don't know
if I have an a or b or what beforehand. Replacing all parts of the formula at
the end would be trickier. I'd prefer to replace incrementally. Any other
ideas?
perezle Guest
-
Adam Cameron #4
Re: Avoiding Evaluate
> I don't know the structure of the formula until the page loads, so I don't know
I'm usually the first person to say "don't use evaluate() if at all> if I have an a or b or what beforehand. Replacing all parts of the formula at
> the end would be trickier. I'd prefer to replace incrementally. Any other
> ideas?
possible", but this is case, it's the correct tool for the job (IMO).
--
Adam
Adam Cameron Guest
-
MikerRoo #5
Re: Avoiding Evaluate
As Adam said,
This is an instance when evaluate is appropriate. Your alternative is to
write an equation parser -- which can be fun but the boss might not understand.
Be sure to wrap the result in HTMLEditFormat or use some other means to guard
against cross-site scripting attacks.
MikerRoo Guest



Reply With Quote

