//------------------------------------------------------------------------
// : GenericityGrammar
// : ﷨ʵ
// : ʽӦ
// : ûӦ
// : Void
//------------------------------------------------------------------------
Params
	//˴Ӳ
Vars
	Integer i(0);
	Order tempOrder;
	
	Series<Bool> boolSeries0;
	Series<Integer> intSeries0;
	Series<Numeric> numSeries0;
	Series<String> strSeries0;
	Series<Array<Integer>> intSeriesArr0;
	Series<Array<Numeric>> orderSeriesArr0;	
	
	Array<Bool> boolArr0;
	Array<Integer> intArr0;
	Array<Numeric> numArr0;
	Array<String> strArr0;
	Array<Order> orderArr0;
	Array<Position> posArr0;
	Array<Fill> fillArr0;
	Array<Tick> tickArr0;
	Array<Array<Integer>> intArrArr0;
	Array<Array<Order>> orderArrArr0;	
	
	Global Array<Bool> boolArr;
	Global Array<Integer> intArr;
	Global Array<Numeric> numArr;
	Global Array<String> strArr;
	Global Array<Order> orderArr;
	Global Array<Position> posArr;
	Global Array<Fill> fillArr;
	Global Array<Tick> tickArr;
	Global Array<Array<Integer>> intArrArr;
	Global Array<Array<Order>> orderArrArr;	
	
	Series<Bool> boolSer(True, 1);
	Series<Integer> intSer;
	Series<Numeric> numSer;
	Series<String> strSer;	
	Series<Array<Bool>> boolArrSer;
	Series<Array<Integer>> intArrSer(6, 2);
	Series<Array<Numeric>> numArrSer;
	Series<Array<String>> strArrSer;		
	Series<Array<Array<Bool>>> boolArrArrSer;
	Series<Array<Array<Integer>>> intArrArrSer;
	Series<Array<Array<Numeric>>> numArrArrSer;
	Series<Array<Array<String>>> strArrArrSer;
		
	Dic<Bool> boolD("boolName");
	Dic<Integer> intD("intName");
	Dic<Numeric> numD("numericName");
	Dic<String> strD("strName");	
	Dic<Array<Bool>> boolArrD("boolArrName");
	Dic<Array<Integer>> intArrD("intArrName");
	Dic<Array<Numeric>> numArrD("numericArrName");
	Dic<Array<String>> strArrD("strArrName");	
	Dic<Array<Array<Bool>>> boolArrArrD("boolArrArrName");
	Dic<Array<Array<Integer>>> intArrArrD("intArrArrName");
	Dic<Array<Array<Numeric>>> numArrArrD("numericArrArrName");
	Dic<Array<Array<String>>> strArrArrD("strArrArrName");
	
	
	Global Map<Integer, Bool> int2bool;
	Global Map<Integer, Integer> int2int;
	Global Map<Integer, Numeric> int2num;
	Global Map<Integer, String> int2str;	
	Global Map<String, Bool> str2bool;
	Global Map<String, Integer> str2int;
	Global Map<String, Numeric> str2num;
	Global Map<String, String> str2str;	
	Global Map<Integer, Array<Bool>> int2boolArr;
	Global Map<Integer, Array<Integer>> int2intArr;
	Global Map<Integer, Array<Order>> int2orderArr;
	Global Map<Integer, Array<Array<Integer>>> int2intArrArr;
	Global Map<Integer, Array<Array<Order>>> int2orderArrArr;

Defs
 	Integer arrayParam(Array<Integer> iArr, Array<Array<Integer>> iArrArr)
	{
		FileAppend(FormulaName() + ".txt", "arrayParam iArr=" + TextArray(iArr));
		FileAppend(FormulaName() + ".txt", "arrayParam iArrArr=" + TextArray(iArrArr));
		Return 0;
	}
	
	Integer arrayRefParam(ArrayRef<Integer> iArr, ArrayRef<Array<Integer>> iArrArr)
	{
		FileAppend(FormulaName() + ".txt", "arrayRefParam iArr=" + TextArray(iArr));
		FileAppend(FormulaName() + ".txt", "arrayRefParam iArrArr=" + TextArray(iArrArr));
		Return 0;
	}
	
	Integer mapParam(Map<Integer, Integer> i2i, Map<Integer, Array<Integer>> i2iArr, Map<Integer, Array<Array<Integer>>> i2iArrArr)
	{
		FileAppend(FormulaName() + ".txt", "mapParam i2i=" + TextMap(i2i));
		FileAppend(FormulaName() + ".txt", "mapParam i2iArr=" + TextMap(i2iArr));
		FileAppend(FormulaName() + ".txt", "mapParam i2iArrArr=" + TextMap(i2iArrArr));
		Return 0;
	}
	Integer mapRefParam(MapRef<Integer, Integer> i2i, MapRef<Integer, Array<Integer>> i2iArr, MapRef<Integer, Array<Array<Integer>>> i2iArrArr)
	{
		FileAppend(FormulaName() + ".txt", "mapRefParam i2i=" + TextMap(i2i));
		FileAppend(FormulaName() + ".txt", "mapRefParam i2iArr=" + TextMap(i2iArr));
		FileAppend(FormulaName() + ".txt", "mapRefParam i2iArrArr=" + TextMap(i2iArrArr));
		Return 0;
	} 
Events
	OnInit()
	{		
		FileDelete(FormulaName() + ".txt");
		FileAppend(FormulaName() + ".txt", "posArr.size=" + Text(GetArraySize(posArr)));
		orderArr[0] = tempOrder;
		FileAppend(FormulaName() + ".txt", "orderArr.size=" + Text(GetArraySize(orderArr)));
		orderArr[1] = tempOrder;
		FileAppend(FormulaName() + ".txt", "orderArr.size=" + Text(GetArraySize(orderArr)));		
		intArrArr[1][1] = 666;
		FileAppend(FormulaName() + ".txt", "intArrArr=" + TextArray(intArrArr));
		
		int2int[0] = 111;
		FileAppend(FormulaName() + ".txt", "int2int.size=" + Text(GetMapSize(int2int)));
		int2int[0] = 222;
		FileAppend(FormulaName() + ".txt", "int2int.size=" + Text(GetMapSize(int2int)));
		int2int[5] = 666;
		FileAppend(FormulaName() + ".txt", "int2int.size=" + Text(GetMapSize(int2int)));		
		GetMapKeys(int2int, intArr);
		For i = 0 To GetArraySize(intArr) - 1
		{
			FileAppend(FormulaName() + ".txt", "int2int[" + Text(intArr[i]) + "]=" + Text(int2int[intArr[i]]));
		}
		
		int2orderArr[0][0] = tempOrder;
		int2orderArr[0][0].orderId = 1;
		int2orderArr[0][1] = tempOrder;
		int2orderArr[0][1].orderId = 2;
		int2orderArr[0][2] = tempOrder;
		int2orderArr[0][2].orderId = 3;
		int2orderArr[0][3] = tempOrder;
		int2orderArr[0][3].orderId = 4;
		orderArr = int2orderArr[0];
		For i = 0 To GetArraySize(orderArr) - 1
		{
			FileAppend(FormulaName() + ".txt", "orderArr[" + Text(i) + "].orderId=" + Text(orderArr[i].orderId));
		}
		
		int2intArrArr[3][0][0] = 111;
		int2intArrArr[6][1][1] = 222;
		int2intArrArr[9][2][2] = 333;
		FileAppend(FormulaName() + ".txt", "int2intArrArr=" + TextMap(int2intArrArr));	
		MapErase(int2intArrArr, 9);
		FileAppend(FormulaName() + ".txt", "int2intArrArr=" + TextMap(int2intArrArr));	
		
	}
	OnReady()
	{
		intSer[0] = 6;
		FileAppend(FormulaName() + ".txt", "intSer[0]=" + Text(intSer[0]));		
		numArrSer[0][0] = 66.66;
		FileAppend(FormulaName() + ".txt", "numArrSer[0][0]=" + Text(numArrSer[0][0]));		
		intArrArrSer[0][0][0] = 666;
		FileAppend(FormulaName() + ".txt", "intArrArrSer[0][0][0]=" + Text(intArrArrSer[0][0][0]));
		
		intD[1] = 6;
		FileAppend(FormulaName() + ".txt", "intD[1]=" + Text(intD[1]));		
		numArrD[0][1] = 66.66;	
		FileAppend(FormulaName() + ".txt", "numArrD[0][1]=" + Text(numArrD[0][1]));		
		FileAppend(FormulaName() + ".txt", "numArrD[0]=" + TextArray(numArrD[0]));	
		strArrArrD[0][1][1] = "hello,world";
		FileAppend(FormulaName() + ".txt", "strArrArrD[0][1][1]=" + strArrArrD[0][1][1]);	
		FileAppend(FormulaName() + ".txt", "strArrArrD[0][1]=" + TextArray(strArrArrD[0][1]));
		FileAppend(FormulaName() + ".txt", "strArrArrD[0]=" + TextArray(strArrArrD[0]));
		
		arrayParam(intArr, intArrArr);
		arrayRefParam(intArr, intArrArr);
		
		mapParam(int2int, int2intArr, int2intArrArr);
		mapRefParam(int2int, int2intArr, int2intArrArr);
	}
	


//------------------------------------------------------------------------
// 汾:	2019/07/17 171857
// Ȩ	riv
// 	TradeBlazer SoftwareTradeBlazerƽ̨
//			ÿһ汾TradeBlazerʽ޸ĺдȨ
//------------------------------------------------------------------------