/*
IndexDefs, IndexName, Update, Count, Items, Fields, Name example
This example uses the IndexName property to sort the records in a client dataset on the CustNo and OrderNo fields.
*/
// Get the current available indices
ClientDataSet1->IndexDefs->Update();
/* Find one which combines Customer Number ("CustNo") and Order Number ("OrderNo")
for (int I = 0; I < ClientDataSet1->IndexDefs->Count; I++)
  if (ClientDataSet1->IndexDefs->Items[I]->Fields == String("CustNo;OrderNo"))
  {
    // set that index as the current index for the dataset
    ClientDataSet1->IndexName = ClientDataSet1->IndexDefs->Items[I]->Name;
  } 
