on ‎2008 Feb 14 3:22 PM
I am looking for a function in xPath that is equivalent to eval() in javascript.
Basically I have to fields in a database used for conversion
Operator --values can be * + - /
Amount --numeric value
I want to apply the operator and amount to a value inside a transaction.
Example.
Local.Operator = " * "
Local.Amount = 10
I am looping through tag values and want to dynamically apply the operator and amoun
Local.NewAmount = LoopValue Local.Operator Local.Amount
I want it to evaluate it to Local.NewAmount = LoopValue * 10
in javascript it is eval(LoopValue Local.Operator Local.Amount).
Any ideas how to do this in a transaction?
Thanks
Request clarification before answering.
Why not just use the calculated columns action in BLS and/or dynamic references (#XXXX.YYY#) in your expressions? That should work. The dynamic references get replaced before the expression is evaluated.
Edited by: Rick Bullotta on Feb 14, 2008 1:53 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the idea, I will give it a try.
I also created a small transaction that just uses a switch statement based on the operator, and then adds, multiplies etc. Then returns the value. It works well for reuse, since multiple transactions need this funcitonality.
Just have to see which method works better.
Thanks again,
Jeff
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.