Fill vector with double type data
Fill vector with integer type data
With system variable @DET, you can decide to use specified value dEndVal or last calculated value as end value of range. |
BOOL Data( double dStartVal, double dEndVal, double dIncVal = 1.0 )
BOOL Data( int nStartVal, int nEndVal, int nIncVal = 1 )
Returns TRUE on success, FALSE on failure to generate data.
Returns TRUE on success, FALSE on failure to generate data.
EX1
void vectorbase_Data_Ex1() { vector<double> vec; if( FALSE == vec.Data(0.0, 1.0, 0.3) ) { out_str("Error filling vector with data."); return; } for( int i = 0; i < vec.GetSize(); i++ ) printf("%2d == %f\n", i, vec[i]); }
EX2
void vectorbase_Data_Ex2() { vector<int> vec; if( FALSE == vec.Data(1, 10, 2) ) { out_str("Error filling vector with data."); return; } for( int i = 0; i < vec.GetSize(); i++ ) printf("%2d == %d\n", i, vec[i]); }
Fill vector with double/integer type data generated using specified min, max and increment value. The vector will be automatically resized and populated with data values such that the first element in the vector will be dStartVal/nStartVal and the last element in the vector will be greater than or equal to dEndVal/nEndVal. If dIncVal/nIncVal is passed in as zero the function will fail.
origin.h