OLEObject object type – PB Docs 126
OLEObject object type PowerBuilder’s OLEObject object type is designed for automation. OLEObject is a dynamic object type, which means that the compiler will accept any property names, function names, and parameter lists for the object. PowerBuilder does not have to know whether the properties and functions are valid. This allows you to call methods and…
Creating hot links – PB Docs 126
Creating hot links Some OLE servers support property change notifications. This means that when a property is about to be changed and again after it has been changed, the server notifies the client, passing information about the change. These messages trigger the events PropertyRequestEdit and PropertyChanged. PropertyRequestEdit event When a property is about to change,…
Handling errors – PB Docs 126
Handling errors Statements in scripts that refer to the OLE server’s properties are not checked in the compiler because PowerBuilder does not know what syntax the server expects. Because the compiler cannot catch errors, runtime errors can occur when you specify property or function names and arguments the OLE server does not recognize. Chain of…
Ancestor and descendent variables – PB Docs 126
Ancestor and descendent variables All objects in PowerBuilder are descendants of PowerBuilder system objects—the objects you see listed on the System page in the Browser. Therefore, whenever you declare an object instance, you are declaring a descendant. You decide how specific you want your declarations to be. As specific as possible If you define a…
OLEObjects for efficiency – PB Docs 126
OLEObjects for efficiency When your automation command refers to a deeply nested object with multiple server qualifiers, it takes time to negotiate the object’s hierarchy and resolve the object reference. If you refer to the same part of the object hierarchy repeatedly, then for efficiency you can assign that part of the object reference to…
Automation and the Any datatype – PB Docs 126
Automation and the Any datatype Because PowerBuilder knows nothing about the commands and functions of the server application, it also knows nothing about the datatypes of returned information when it compiles a program. Expressions that access properties and call functions have a datatype of Any. You can assign the expression to an Any variable, which…
Qualifying server commands – PB Docs 126
Qualifying server commands Whether to qualify the server command with the name of the application depends on the server and how the object is connected. Each server implements its own version of an object hierarchy, which needs to be reflected in the command syntax. For example, the Microsoft Excel object hierarchy is shown in Figure…
Calling functions – PB Docs 126
Calling functions You can call server functions for an OLE control through its Object property using the following syntax:
1 |
<span>olecontrolname</span>.<span>Object</span>.{<span> serverqualifiers</span>.}<span>functionname</span> ( { <span>arguments</span> } ) |
If the OLE object is complex, there could be nested properties or objects within the object that serve as qualifiers for the function name. Required parentheses PowerScript considers all commands to the server either property…
Setting properties – PB Docs 126
Setting properties You access server properties for an OLE control through its Object property using the following syntax:
1 |
<span>olecontrolname</span>.<span>Object</span>.{<span> serverqualifiers</span>.}<span>propertyname</span> |
If the OLE object is complex, there could be nested objects or properties within the object that serve as qualifiers for the property name. For example, the following commands for an Excel spreadsheet object activate the…
The automation interface – PB Docs 126
The automation interface In PowerBuilder, an OLEObject is your interface to an OLE server or ActiveX control. When you declare an OLEObject variable and connect to a server, you can use dot notation for that variable and send instructions to the server. The instruction might be a property whose value you want to get or…