SetAt

PowerBuilder Native Interface

PBObjectArrayAccessor class:

SetAt method

Description

Sets the array item at the specified dimension.

Syntax

SetAt(pblong dim[], pbobject obj)

Argument

Description

dim

The dimension of the array item to be set

obj

A valid object handle

Return Values

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