SetAt

PowerBuilder Native Interface

PBBoundedArrayCreator template class:

SetAt method

Description

Syntax

SetAt(pblong dim[], ValueType v)
SetAt(pblong dim[], LPCTSTR string)
SetAt(pblong dim[], pbstring string)

Return Values

Examples

// arguments: 
// ac: class object of PBBoundedArrayCreator or
// PBBoundedObjectArrayCreator to set items into
// dimensions: array dimension, can be 1,2,3,...,n
// bounds: upper and lower bound for each dimension
// iarg: T type array to store the data value set
// into array creator ac
// current_dim: remember which dimension is looped into

template < typename T, pbvalue_type I,class C>
void BoundedArrayItem<T,I,C>::f_set_arrayitem
   (IPB_Session* session, C& ac, pblong dimensions,
   arrayBounds* bounds, T* iarg, int current_dim)
{
  int i;
  if (current_dim > dimensions)
    return;
  for(i= bounds[current_dim-1].lowerBound;
    i<= bounds[current_dim-1].upperBound; i++)
  {
    if (current_dim == dimensions)
    {
      dim[current_dim-1]= i;
      ac.SetAt(dim,iarg[array_itemcount]);
      array_itemcount++;
    }
    else
    {
      dim[current_dim-1]= i;
      BoundedArrayItem<T,I,C>::f_set_arrayitem
        (session, ac, dimensions, bounds, iarg,
         current_dim+1);
    }
  }
}

See Also