Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Methods of access to objects

To allow calling methods or writing (reading) into object properties, it must be understood how to access these objects in an algorithm (script) (how to get the reference to it).
 

1. Access to Promotic objects and to their subobjects

It is possible to access Promotic objects and their subobjects in a script by following standard methods:
- by the PmObject.Pm method.
- by parameters of an object event (e.g. pMe).
 
The path describes the location of the object in the tree structure. Each tree level adress is separated by the / character. The immersed Promotic object is referrenced by its name. The superior Promotic object is referrenced by .. characters. The immersed implementation subobject (other than PmObject type) is referrenced by # character, followed by the implementation subobject type definition (e.g. #vars). It means that, the # addressing leaves the Promotic application object tree (created by user) and starts to address the implementation subobjects of the PROMOTIC object. For example "/appdata/data/#vars/Temperature".

2. Access to graphic items

It is possible to access graphic items in a script by following standard methods:
- by the PmiItem.Items method.
- by parameters of an object event (e.g. pMe).

3. Access to ActiveX objects

We access the nongraphic ActiveX element placed in the application editor (PmActiveX object) by means of the PmActiveX.Acx property.
We access the graphic ActiveX element placed in the panel editor (PmiAx graphic item) by means of the PmiAx.Acx property.

4. Access to Pm object

The reference to the Pm object is stored in the Pm variable that is a variable of the PROMOTIC system (hence it is not defined by a user). For this reason, properties and methods of this object are accessed by writing Pm.property in the script.
Example:
The following notation will cause writing the "Promotic" text to the Debug_info item of the INFO system
Pm.Debug "Promotic"
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice