Promotic

EvalMacro - method of the Pm object

Description:
Evaluation of the macro expression.
Syntax:
String EvalMacro(String sMacro, [String sParams])
Parameters:
sMacro(String) Macro expression, see Description of macro expressions in the PROMOTIC system.
sParams[optional] (String) Additional parameters for macro expression evaluation. Entries are in the KeyVal format, for example "lang:cs;".
"lang:ss;" (optional) - Specifies national language for Macro expression $.text. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system.
If not set, then the present language of the application is used instead.
See the "PmaRoot > Application > Main language of runtime" configurator.
Return value:
Returns a value of the evaluated macro expression in text form
Note:
The method cannot be used for evaluating the $.par macro expression. The following methods can be used: PmaObject.GetPar method (for Pma objects) or PmgObject.GetPar method (for Pmg objects).

This method is not functional in Web panels.
Example1:
Detects value from the configuration file
JavaScriptVBScriptSelect and copy to clipboard

var sVal = Pm.EvalMacro("$.cfgfile('config/data/port1',0)");
Example2:
Reading of appropriate localized text in english language
JavaScriptVBScriptSelect and copy to clipboard

var sTxt = Pm.EvalMacro("$.text('sys','userDesc')", "lang:en;");
Another option of obtaining localized text is to use #pragma variable - this is functional also in Web panels.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- EvalMacro
 
 
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.