IsGlobalVarObject

PowerBuilder Native Interface

IPB_Session interface:

IsGlobalVarObject method

Description

Returns true if the global variable contains an object; otherwise it returns false.

Syntax

IsGlobalVarObject( pbfield fid)

Argument

Description

fid

The field ID of the global variable

Return Values

pbboolean.

Examples

These statements test whether the field identified by fid is a global variable object. If it is, its value is set to another global variable object:

fid = session -> GetGlobalVarID("obj2_gvar");
   if (session -> IsGlobalVarObject(fid))
   {
      obj_val = session -> GetObjectGlobalVar(fid,
         isNull);
      cls = session -> GetClass(obj_val);
      fid = session -> GetFieldID(cls, "text");
      s_val = session -> GetStringField(obj_val, fid,
         isNull);
      mystr = session -> GetString(s_val);
      // Set the value of obj2_gvar to obj1_gvar
      fid = session -> GetGlobalVarID("obj1_gvar");
      session -> SetObjectGlobalVar(fid, obj_val);
   }

See Also