Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Methods - property of object PmaObject

Description:
Returns the object, by which the designer's methods defined on the "Methods" page are accessed.
Syntax:
Object Methods
Calling:
oObject.Methods.method1 par1, par2 ...
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 for Web panels. See Example2.

Calling the methods for 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 picture 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 main and working 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 theread (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 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.

Example1:
An 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 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 from 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 Methods configuration page.
PROMOTIC 9.0.6 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice