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

GetPBAnyField – PB Docs 2019 – PowerBuilder Library

GetPBAnyField – PB Docs 2019

GetPBAnyField

Description

Obtains the value of a variable of type Any.

Syntax

Argument

Description

obj

A valid object handle for the object whose value is
to be obtained

fid

The field ID of the variable

isNull

Indicates whether the variable is
null

Return value

IPB_Value*.

Examples

This example tests all the functions used to get the value of
variables of type Any, using PushLocalFrame and PopLocalFrame to
simulate the scope of a function call:

Usage

The value you retrieve must be of datatype Any to use this
function; that is, the variable associated with the function must be
declared as a variable of type Any in the development environment. If it
is not, the function returns a null pointer and the value of isNull is
set to true.

This function returns a pointer to an IPB_Value instance. When it
is called, memory is allocated for the returned IPB_Value instance, and
the pointer is recorded in the current local frame. The pointer is
deleted automatically when the current local frame is popped, which
occurs when the current local function returns (you can also call
PopLocalFrame to force the frame to be popped).

If you want to use the value returned, you must save the value
pointed to by the IPB_Value instance (not the IPB_Value instance itself)
before the frame is popped. If you save the pointer itself, the value is
only valid until the original value is destroyed.

You can use the AcquireValue function to save the value, or one of
the IPB_Value Get<type> functions. For example, the following code
saves the string value in the IPB_Value instance ivalue into the string
str. The value in str can be used after the local frame is popped and
ivalue is deleted:

If you do not know the actual datatype of the Any variable, use
the IPB_Value GetType function to get its datatype first, then use the
appropriate get function to get its value.

IPB_Value holds a reference to the original value

The value in the IPB_Value instance is a reference to the
original value. If you change the actual value of the returned
IPB_Value, the original value is also changed. If you use the
AcquireValue function to save the value, it clones a new IPB_Value and
resets the existing IPB_Value pointer.

See also

GetPBAnyArrayItem

GetPBAnyGlobalVar

GetPBAnySharedVar


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