package Set;

import j4d.open.*;

class Examplet {

  /* doCreateSet allows you to create a set from a selection
  / In this sample, we select all records and reduce the selection to half
  / Then, we create a set named "My_Beautifull_Set"
  */
  public void doCreateSet(opProcess process) throws opException{

    int mTargetTable = 1;

    try {
      opTable mTable = new opTable(mTargetTable);
      opSelection mSelection = process.AllRecords(mTable);
      mSelection.mRecordsInSelection = (mSelection.mRecordsInSelection - 1) / 2;
      process.ReduceSelection(mSelection);
      opSet mSet = new opSet(mTargetTable, 5, "My_Beautifull_Set");
      process.CreateSet(mSet);
    }
    catch (opException er){throw er;}
  }

}