Description
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.
Methods
PBUnboundedObjectArrayCreator has two methods:
Description
Obtains an array that has been created.
Syntax
GetArray()
Return value
pbarray.
Examples
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();
See also
Description
Sets the array item at the specified position.
Syntax
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 |
Return value
None.
Examples
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();
See also