Promotic

Methods - property of the PmaObject object

Description:
Returns object, by which the designer's methods defined on the "Methods" tab are accessed.
Syntax:
Object Methods
Note:
Property access for read only.
 
The property itself cannot be changed (is "read only"), but the called method can change anything by its algorithm.

Designer's methods in the PmaPanel object:
This property is also functional in Web panels. See Example2.
Calling the methods for the Web is protected by the "WebMethods" permission.
Limitations: Called methods can have parameters and an output value (pResult) only:
- simple data types (e.g. Integer, String, etc.)
- 1-dimensional array defined e.g. Dim arr(20)
- 2-dimensional array defined e.g. Dim arr(10,20)
- there must not be other arrays in the array items

Calling this method for Web panels should be used with limit because each such calling performs a XML communication with the server! If, for example, 100 Pmg objects were in the panel and this method in the onRefresh event was called in each such Pmg object, then 100 communications would been performed step by step during each refresh of the picture, which wouldn't been probably acceptable.

Designer's methods in the PmaSequencer object: The PmaSequencer object is special because its the onStep event is triggered in main or working thread ("thread:work;" or "thread:main;"). Therefore the methods were doubled internally and then compiled in both: in the main thread and in the worker thread. If the method is called from the working thread, then it is executed in this thread. In other cases it is executed in the main thread (as other object methods are).
This allows easy creation of auxiliary functions making the onStep event itself much better arranged. Even if the onStep event is called alternatively in main and working thread the method is then called automatically in the corresponding thread.

Designer's methods in the PmaRoot object:
Methods in the PmaRoot object (application global methods) are called by means of the Pm.Methods property.
See also:
- Pm.Methods (property)
- PmgObject.Methods (property)
Example1:
Example of the access to the methods with the user's names Init and Close (x and y are parameters of the "Init" method)
JavaScriptVBScriptSelect and copy to clipboard

oObject.Methods.Init(x, y);
return oObject.Methods.Close();
Example2:
The methods of the PmaPanel object can be called also from the events of Pmg objects. They can be called even if the panel is created for the Web - in this case the panel-client calls this method remotely by means of the XML communication! This way, for example, the method would be called in the onButtonUp event of the PmgButton object:
JavaScriptVBScriptSelect and copy to clipboard

var nVal = pMe.PmPanel.Methods.GetMyValue(x, y);
Next examples:
See: Example in the description of the "Methods" tab.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.