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

SetProp – PB Docs 125 – PowerBuilder Library

SetProp – PB Docs 125

IPB_Session interface:

SetProp method

Description

Adds a new variable to the list of properties of the current
session or changes the value of an existing variable.

Syntax

Argument

Description

name

The name of the property to be set

data

A pointer to the data buffer where the
variable’s value resides

Return Values

None.

Examples

In this example, the native class has two functions.
This is their description passed in the PBX_GetDescription function:

The functions are associated with these enumerated values:

When the f_setprop function is
called from PowerBuilder, the following code sets the value of the
pointer SetVal to the integer value passed
in by f_setprop, then registers that
value in the session with the property name prop_name:

When the f_getprop function is
called, the following code uses GetProp to set the GetValue pointer
to point to the value associated with prop_name,
and then sets the return value to *GetValue:

Usage

SetProp enables you to use a variable value
throughout an IPB session without using a global variable, which
is susceptible to namespace conflicts with other sessions. SetProp is
one of a set of three functions:

  • Use SetProp to
    register a new variable with the session or to change the value
    of an existing variable.

  • Use GetProp to access the variable.

  • Use RemoveProp to remove the
    variable from the list of variables associated with the session
    when it is no longer needed.

This set of functions is particularly useful for working with
multiple threads of execution in EAServer.

Suppose you want to throw an exception from within a PBNI
extension and the exception itself is also defined by the PBNI extension.
You call the IPB_Session NewObject function
to create an instance of the exception, causing the PBX_CreateNonVisualObject function
to be called.

One way to set the value of the fields of the exception before
the function returns in a thread–safe manner is to create
a new object or structure to hold the exception information before
calling NewObject. You can call SetProp to
store the structure or the object in the current IPB_Session.
When PBX_CreateNonVisualObject is called,
you can call GetProp to get the structure or
object to obtain the exception information, then call RemoveProp to
remove the data you stored in the current session.

See Also


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