This macro expression returns the evaluated expression written in
JavaScript syntax.
Syntax:
$.expr("expression")
where
"expression" may contain:
- Constant: Numeric (e.g. 1, 3.14) or string (e.g. '.mdb', 'Pressure').
Caution! String constants must be written with simple quotation marks (if doubled quotation marks were used for the whole expression), or backslash \" must be written before the quotation marks.
-
pMe variable:
Represents
Pma object or
Pmg object - according to the object where the macro is defined.
The
pMe can then be used for accessing properties or methods.
Caution! This variable is not functional for
Web panels and in data extension.
-
pDE variable:
Only for data extensions where it substitutes the
pMe variable.
Represents the scripting interface of data extension, see
Data extensions.
The
pDE.Var property (for example
ExtAlarmAnalog.Var) returns the
PmVar object, containing the data extension, accessible.
-
pVar variable:
Only for data extensions where it substitutes the
pMe variable.
Represents the scripting interface of data extension, see
Data extensions.
The
pVar property (for example
ExtAlarmAnalog.Var) returns the
PmVar object, containing the data extension, accessible.
-
Pm variable: Represents the
Pm object.
Caution! This is a special, limited version of the
Pm object that allows to use its mathematical, string, array, date and time, etc. However the functions related to the application itself or to the PROMOTIC system are
not available (e.g. the logged-in user, application priority, launch date, calling global methods, etc.).
Example1:
The
xx parameter value is
3. Then the evaluated expression equals to
13yy (not
4yy) because of the
string summation.
The value of the parameter (
$.par) always returns a value of the
String type.
JavaScript always executes the
+ operation as a string summation if there is at least one string among the operands.
The mathematical sumation is executed only if
both operands are of the numeric type (see Example2).
$.expr("1+$.par('xx',0)+'yy'")
Example2:
The
xx parameter value is
3. Then the evaluated expression equals to
4yy because of the
mathematical summation.
The value of the parameter (
$.par) always returns a value of the
String type that is converted by means of the
Pm.ToNumber method into a number.
JavaScript executes the
+ operation as a mathematical summation because
both operands are of the numeric type (contrary to Example1).
Configurators in extended value editor:
JavaScript expression | Expression written in JavaScript syntax |
---|