LookUp
Look up a category in this CategoricalMap and return its index.
int LookUp( LPCSTR lpcszCategory )
Returns the index (1 based offset) of the category in this CategoricalMap if the category is found and returns -1 if it is not found.
EX1
void CategoricalMap_LookUp_ex1() { Worksheet wks; wks.Create(); if (wks) { Dataset ds(wks, 0); ds.SetSize(8); vector<string> vs = {"aaa","bbb","ddd","ccc","qqq","777","aaa","ddd"}; ds.PutStringArray(vs); string strWksColname = wks.Columns(0).GetName(); strWksColname = wks.GetPage().GetName() + "_" + strWksColname; StringArray vMyCatMap; CategoricalData cdMyCatData(strWksColname); vMyCatMap = (StringArray) cdMyCatData.Map; int index = cdMyCatData.Map.LookUp("ddd"); //index = 3, if look up "eee", index = -1 string strVal = cdMyCatData.Map.ReverseLookUp(5); } }
Look up a category (text value) in this CategoricalMap and return its index(1 based offset). If the CategoricalMap has an associated CategoricalData data set then all text data values in the CategoricalData data set equal to the specified category are mapped to the category's index value. For EX1, the text value "ddd" is mapped to the index 3.
CategoricalMap::ReverseLookUp
origin.h