Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Calling PowerScript from an extension – PB Docs 2022 – PowerBuilder Library

Calling PowerScript from an extension – PB Docs 2022

Calling
PowerScript from an extension

You can call PowerBuilder system functions through IPB_Session. The
InitCallInfo method simplifies the process of setting up the call
information. You need to provide the arguments to the InitCallInfo method,
including an identifier for the PowerBuilder function you want to
call.

The identifier can be returned from the GetMethodID or
FindMatchingFunction method.

Using GetMethodID

To get the function’s ID using the GetMethodID method, you need the
function’s signature:

The signature argument in this method call is a string representing
the method’s return type and arguments. You can obtain this string in the
Browser.

For example, to obtain the signature of a system function, select
systemfunctions from the left pane of the System page, right-click the
function in the right pane, and select Properties from its pop-up
menu:

pbnisig3.gif

For methods in your application, you can expand the object that
contains it in the System Tree, select the function or event, and select
Properties from its pop-up menu:

pbnisig1.gif

Consider this function:

The signature for this function is QRCtransaction. Q indicates that
the function does not return a value, R that the argument is passed by
reference, and Ctransaction that the argument is a PowerBuilder system
object of type transaction.

You can use the pbsig220 command-line tool to obtain a function’s
signature. However, the pbsig220 tool does not report the signature of
functions that are inherited from an ancestor object unless they are
extended in the descendant, and it does not report event
signatures.

For more information about using pbsig220, and an explanation of all
the formats used in the signature, see pbsig220.

Using FindMatchingFunction

Instead of the string that GetMethodID uses, the
FindMatchingFunction function provides another way to get the method ID.
Some short signatures can be difficult to parse, and signatures that
include PowerBuilder system objects or Java classes can be much
longer.

FindMatchingFunction uses a “readable signature” instead of the
string used by GetMethodID:

The readableSignature argument is a comma-separated list of the
arguments of the function. Unlike the string used by GetMethodID, it does
not include the return type. For example, for a function called
uf_test that takes two arguments, an int by value and a double by
reference, the call to FindMatchingFunction looks like this:

Invoking PowerBuilder
functions

The following methods are those you use most frequently to invoke
PowerBuilder functions. For descriptions of each method, see IPB_Session interface.


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