Qualifying server commands – PB Docs 125

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 19-2.

Figure 19-2: Microsoft Excel object hierarchy

oleap04.gif

When the server is Excel, the following commands appear to
mean the same thing but can have different effects (for an Excel
95 spreadsheet, the cells’ row and column arguments are
in parentheses instead of square brackets):

The first statement changes a cell in the active document.
It moves up Excel’s object hierarchy to the Application
object and back down to an open sheet. It does not matter whether
it is the same one in the PowerBuilder control. If the user switches
to Excel and activates a different sheet, the script changes that one
instead. You should avoid this syntax.

The second statement affects only the document in the PowerBuilder
control. However, it will cause a runtime error if the document
has not been activated. It is the safer syntax to use, because there
is no danger of affecting the wrong data.

Microsoft Word 6.0 and 7.0 implement the application hierarchy
differently and require the qualifier application.wordbasic when
you are manipulating an object in a control. (You must activate
the object.) For example:

Later versions of Microsoft Word do not require a qualifier,
but it is valid to specify one. You can use any of the following
syntaxes:

When you are working with PowerBuilder’s OLEObject,
rather than an object in a control, you omit the application qualifiers
in the commands because you have already specified them when you
connected to the object. (For more about the OLEObject object type,
see “Programmable OLE Objects “.)


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x