There are two versions of the PBUnboundedArrayCreator template class. The first version is used to create an unbounded array of a standard type. The standard types are defined as ValueTypes in pbtraits.h and are pbint, pbbyte, pbuint, pblong, pblonglong, pbulong, pbboolean, pbreal, pbdouble, pbdec, pbdate, pbtime, pbdatetime, pbchar, pbblob, and pbstring. The second version is used to create an unbounded array of strings.
PBUnboundedObjectArrayCreator has two methods:
Obtains an array that has been created.
GetArray()
pbarray.
This example sets the values in an array and then uses GetArray to obtain the array:
PBUnboundedArrayCreator<pbvalue_string> ac(session); for (i=0; i<itemcount1; i++) { ac.SetAt(i+1,iarg[i]); } out_array = ac.GetArray();
Sets the array item at the specified position.
For arrays of a specified ValueType:
SetAt(pblong pos, ValueType v)
For string arrays:
SetAt(pblong pos, LPCTSTR string)
SetAt(pblong pos, pbstring string)
Argument |
Description |
---|---|
pos |
A pblong identifying a position in the array |
v |
A ValueType defined in pbtraits.h |
string |
A string of type pbstring or LPCTSTR |
None.
This example shows the use of SetAt in arrays of a type specified by a ValueType:
PBUnboundedArrayCreator<I> ac(session); in >> iarg[i]; for (i=0; i<itemcount1; i++) { ac.SetAt(i+1, iarg[i]); } out_array = ac.GetArray();