mb_set_array

Previous  Next

 

bool_t mb_set_array( LPARRAY pArr, LPIXARRAY ix_array, mb_value_t val )

 


 

Initializes an entire array or part of an array using the ix_array.

 

Example

 

/////////////////////////////////////////////////////////////////////////////

// Simple class to attach a MyBASIC2 _array_t to the class and then set

// a value in the array

//

class CRealArray

  {

  public:

     CRealArray( LPARRAY pArray )

        {

        m_pArray pArray;

        }

     endfunc

 

     void Set( int* ix_array, mb_value_t val )

        {

        mb_set_array( m_pArray, ix_array, val );

        }

     endfunc

 

     void Set( int* ix_array, real_t rValue )

        {

        mb_value_t val = { MB_DT_REAL, NULL, rValue };

        Set( ix_array, val );

        }

     endfunc

 

  protected:

     LPARRAY      m_pArray;

  }

endclass