Hi,
I'm creating a PBNI using the SDK and C. I would like to know how I can create a multi dimensional pbarray and set it's values. I have a single dimension array working fine but can't figure out what to create a 2 dimensional pbarray.
pbarray sgpinterface::floatArrayToPBArray(IPB_Session * session, float data[], int size) {
pbuint numDimensions = 1; // Set This To 2 For 2D Array
PBArrayInfo::ArrayBound bound;
bound.lowerBound = 1;
bound.upperBound = size;
pbarray dataArray = session->NewBoundedSimpleArray(pbvalue_dec, numDimensions, &bound);
pblong dim[1];
for (int i = 0; i < size; i++) {
dim[0] = i + 1; // What Should This Be For 2D Reference?
float floatVal = data[i];
char b[100];
sprintf_s(b, 100, "%f", floatVal);
pbdec decval = session->NewDecimal();
session->SetDecimal(decval, (LPCSTR)b);
session->SetDecArrayItem(dataArray, dim, decval); // How To Use Dim Here To Set 2D Array Value?
}
return dataArray;
}