EvalMacro - method of object Pm

Evaluation of the macro expression.
EvalMacro(sMacro As String, [sParams As String]) As String
x = Pm.EvalMacro(sMacro)
sMacro(String) Macro expression, see PROMOTIC system macro expressions description.
sParams[optional] (String) Additional parameters for macro expression evaluation. Entries with assigned value are separated by a semicolon, for example "lang:cs;".
"lang:ss;" (optional) - Requested 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 the language is not defined, the present language of application is used instead. See the configurator "PmRoot > Application > Main language of runtime".
Return Values:
Returns the value of the evaluated macro expression in text form
The method can not be used for evaluating the $.par macro expression. The following methods can be used instead: method PmObject.GetPar (for Promotic objects) or method PmiItem.GetPar (for Graphic items).
This method is not so far functional for Web Panels.
Obtain value from configuration file
Dim sVal
sVal = Pm.EvalMacro("$.cfgfile('config/data/port1',0)")
Reading of appropriate localized text in english language
Dim sTxt
sTxt = Pm.EvalMacro("$.text('sys','userDesc')", "lang:en;")
Another option of obtaining localized texts is to use #pragma variable - this is also functional in Web Panels.
- Pm
- Abs
- Cos
- E
- EvalMacro
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice