Description
The PBObjectArrayAccessor class is used to access the items in an object array.
Methods
PBObjectArrayAccessor has two methods:
Description
Obtains the array item at the specified dimension.
Syntax
GetAt(pblong dim[])
Return value
pbobject.
Examples
This example shows the use of GetAt in an object array:
PBObjectArrayAccessor aa(session, *array_val); for (i=0;i<itemcount2;i++) { dim[0] = i+1; oarg = aa.GetAt(dim); cls = session->GetClass(oarg); if( cls == NULL ) return; fid = session->GetFieldID(cls, "text"); if ( fid == 0xffff) return; fid_pv = session->GetFieldAddress(oarg,fid); mystr = fid_pv->GetString(); ostr_a[i] = session->GetString(mystr); }
See also
Description
Sets the array item at the specified dimension.
Syntax
SetAt(pblong dim[], pbobject obj)
Return value
None.
Examples
This example shows the use of SetAt in an object array:
PBObjectArrayAccessor aa(session,*array_val); for (i=0;i<itemcount1;i++) { cls = session->FindClass(group,sp[i]); if( cls == NULL ) return; iarg = session->NewObject(cls); session->ReferenceObject(iarg); dim[0] = i+1; aa.SetAt(dim, iarg); fid = session->GetFieldID(cls, "text"); if ( fid == 0xffff ) return; fid_pv = session->GetFieldAddress(iarg, fid); mystr = fid_pv->GetString(); istr_a[i] = session->GetString(mystr); }
See also