Promotic

Description of macro expressions in the PROMOTIC system

In many Pma objects or Pmg objects configurators in the Pm.EvalMacro method (but also in other methods) can be used the macro expression.
The macro expression for example allows to enter a text expression in the configurator, that is "evaluated" after the application is launched. For example this macro expression can be used for:
- refering to the localized text in the XML file (Macro expression $.text)
- refering to the value in an INI file (Macro expression $.cfgfile)
- create a complex evaluation of multiple macros, etc.


The macro expression is evaluated always only once, at application launch, when opening a panel or when calling a method (based on logic of placing) respectively. Therefore it is not possible to assume the macro as a data binding!
For all configurators or methods with possible macro expression entry, this possibility is always explicitly stated in the description (see the "PmgString > Text" configurator). There is also the information about the the macro expression evaluation sequence - usually:
- The macro expression in the configurator of the Pma object is evaluated after the application is launched.
- The macro expression in the configurator of the Pmg object is evaluated while the panel is opening.
- The macro expression in the method parameter is evaluated when calling a method.


List of macro expressions:
$.text: Represents the text read from a text file.
$.par: Reference to Pma object or Pmg object parameter
$.cfgfile: Represents the value stored in the configuration file.
$.join: Represents a string value composed of all parameters of current expression
$.expr: Evaluates an expression written in JavaScript syntax.
$.path: Represents the full path to the folder or to the file.
$const: (obsolete) Represents the text quoted directly from current macro expression.
$vb: (obsolete) Represents the result of the specified VBScript expression evaluation.
See also:
- Pm.EvalMacro (method)

History:
Pm8.03.00: In configurators where macro expressions can be entered, there is a new button on the left (similar to data binding button) that can be used for composing a macro expression by configuration.
Pm8.02.00:
- The syntax of macro expressions has been generalized in order to allow creation of "macros in macros", i.e. so the value in macro expression can be a macro expression. The macro expression now it is possible to enter in simple form ("the old way" that does not allow more complex constructions) and in complex form (with brackets that allow to create macros in macros).
- New Macro expression $.expr for very general evaluation.
Pm8.00.07: can be entered in other configurators, for example:
- in the "PmVar > Variable > Note" configurator.
Pm8.00.06: Re-enabled for additional configurators, for example:
- in objects that contain the "Web server" tab: Web component identifier
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
 
- Macro expression
 
- $vb
 
- SVG
© MICROSYS, spol. s r.o.