Methods - property of object PmObject

The property returns object, by which the user's methods defined on the Methods page are accessed.
Methods As Object
oObject.Methods.method1 par1, par2 ...
Property access for read only. The property itself cannot be changed (it is "read only"), but the called method can change anything by its algorithm.
User methods in PmPanel object:

This property is also functional for Web Panels. See Example2.

Calling the methods for Web is protected by the WebMethods permission.

Limitation: Called methods can have parameters and an output value (pResult) only if:
- 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 pictures should be used with limit because each such calling performs a XML communication with the server! If, for example, 100 items were in the picture and this method in the onRefresh event was called in each such item, then 100 communications would been performed step by step during each refresh of the picture, which wouldn't been probably acceptable.

User methods in PmSequencer object:

The PmSequencer object is special because its main onStep event can be fired in both 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 is called alternatively in main and working thread the method is then called in the corresponding thread.

User methods in PmRoot object:

Methods in PmRoot object (application global methods) are called by the Pm.Methods property.

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)
oObject.Methods.Init x, y
bResult = oObject.Methods.Close()
The methods of the PmPanel object can be called also from the events of graphic items. 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, for example, from the onButtonUp event of the PmiButton graphic item:
nVal = pMe.PmPanel.Methods.GetMyValue(x,y)
Next examples:
See: Example in description of Methods configuration page.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice