Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CObArray::SetAtGrow
CObArray                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  void SetAtGrow( int nIndex, CObject* newElement )
  throw( CMemoryException );
 
  Parameter    Description
 
  <nIndex>     An integer index that is greater than or equal to 0.
 
  <newElement> The object pointer to be added to this array. A NULL value
               is allowed.
 
  Remarks
 
  Sets the array element at the specified index. The array grows
  automatically if necessary (that is, the upper bound is adjusted to
  accommodate the new element).
 
  Example
 
  CObArray array;
 
  array.Add( new CAge( 21 ) ); // Element 0
  array.Add( new CAge( 40 ) ); // Element 1
  array.SetAtGrow( 3, new CAge( 65 ) ); // Element 2 deliberately
                                        // skipped
 
  The results from this program are as follows:
 
  SetAtGrow example: A CObArray with 4 elements
      [0] = a CAge at $47C0 21
      [1] = a CAge at $4800 40
      [2] = NULL
      [3] = a CAge at $4840 65
 
  See Also
 
  CObArray::GetAt, CObArray::SetAt, CObArray::ElementAt,
  CObArray::operator []
 
 
                                     -♦-