2.2.4.11.9 DatasetObject::PatternPattern
 
Description
follow the repeat rules to generate one data series data in a Dataset Object.
 
Syntax
BOOL Pattern(vector<string>& vsSource, int nValueRepeat = 1, int nSequenceRepeat = 1, int i1 = -1, int count = -1) 
Parameters
-  vsSource
 
-  [input] the vector to store the items used to repeat.
 
-  nValueRepeat
 
-  [input] the repeat number for the items in vsSource.
 
-  nSequenceRepeat
 
-  [input] the repeat number of one data series.
 
-  i1
 
-  [input] the begin index of vector.
 
-  count
 
-  [input] the total count of the whole data series.
  
Return
Examples
void datasetobject_pattern_ex1()
{
	Worksheet wks;
	wks.Create(); // create a empty wks with default template
	
	Column col(wks, 0);	
	vector& vec = col.GetDataObject();
	vec.SetSize(100);
	vec = 0; // initialize the vector with 0.
	
	DatasetObject dsObj(col);
	vector<string> vsSource = {"11", "22", "33"};	
	dsObj.Pattern(vsSource, 2, 2, 2);	
	
	/* the data of 1st column will be : 
	0, 0, 11, 11, 22, 22, 33, 33, 11, 11, 22, 22, 33, 33, 0, 0, ...
	*/
}
Remark
See Also
DatasetObject::Uniform
 
Header to Include
origin.h
 
             |