IPB_Session interface:
NewBoundedObjectArray method
Description
Creates a bounded PowerBuilder object or structure array.
Syntax
NewBoundedObjectArray(pbclass cls, pbuint dimension, PBArrayInfo::ArrayBound* bounds)
Argument |
Description |
---|---|
cls |
A valid class handle of the type of PowerBuilder object or structure array to be created |
dimension |
A number greater than one that indicates the dimension of the array to be created |
bounds |
An array containing the upper and lower boundaries of the array to be created |
Return Values
pbarray or null on failure.
Examples
int size;
pbarray pbin_a;
PBArrayInfo* ai;
PBXRESULT ret;
pbclass cls;
pbgroup group;
size = sizeof(PBArrayInfo) +
sizeof(PBArrayInfo::ArrayBound);
ai = (PBArrayInfo*)malloc(size);
ai-> bounds[0].upperBound=2;
ai-> bounds[0].lowerBound=1;
ai-> bounds[1].upperBound=2;
ai-> bounds[1].lowerBound=1;
ai-> numDimensions=2;
// Create new array pbin_a
group = session-> FindGroup("w_main", pbgroup_window);
if (group==NULL)
return;
cls = session->FindClass(group, "commandbutton");
if( cls==NULL)
return;
pbin_a = session->NewBoundedObjectArray(cls,
ai-> numDimensions, ai-> bounds);