GetPBAnyField

PowerBuilder Native Interface

IPB_Session interface:

GetPBAnyField method

Description

Syntax

GetPBAnyField( pbobject obj, pbfieldID fid, pbboolean& isNull )

Return Values

Examples

session->PushLocalFrame();
pbgroup vgroup = session->FindGroup("n_test",
   pbgroup_userobject);
pbclass vcls = session->FindClass(vgroup, "n_test");
pbobject vobj = session->NewObject(vcls);
pbboolean isNull;

pbfieldID vfid = session->GetFieldID(vcls, "i_a");
IPB_Value* value = session->GetPBAnyField(vobj,
   vfid, isNull);
pbstring str = value->GetString(); // save actual value

vfid = session->GetSharedVarID(vgroup, "s_a");
value = session->GetPBAnySharedVar(vgroup,
   vfid, isNull);
//Get the actual value here.

vfid = session->GetGlobalVarID("g_a");
value = session->GetPBAnyGlobalVar(vfid, isNull);
//Get the actual value here.

vfid = session->GetFieldID(vcls, "i_array");
pbarray arr = session->GetArrayField(vobj,
   vfid, isNull);    //Get the any array first.

long dim = 1;
value = session->GetPBAnyArrayItem(arr, &dim, isNull);
//Get the actual value here.
session->PopLocalFrame();

Usage

IPB_Value* ivalue = session->GetPBAnyField(vobj, vfid,
   isNull);
pbstring str = ivalue->GetString();
Note IPB_Value holds a reference to the original value

See Also