Script functions




uEvaluate

Description

Evaluates a function or Java Script expression and returns the result.

Syntax

string uEvaluate(expression)

Parameters

number expression

JavaScript code to evaluate.

Examples

Example 1

To evaluate functions and procedures:

uEvaluate(“if (IN.CUSTNO > 22) {return 22;} else {return IN.CUSTNO;} )”) // Return IN.CUSTNO if IN.CUSTNO is below 22 or return 22 if above.

You can also define your functions for later use. First, you evaluate the following:

function myFunc(a ,b)
{ return a+b;
}

Then, call your function using uEvaluate:

uEvaluate("myFunc(3, 5)")  // Returns 8