Recalculating Results

Scripts that include limits (filters) may execute slowly because the scripts must recalculate the data set each time a limit is modified. You can use the SuspendRecalculate property to prevent a results limit from forcing recalculations.

Example—Limit values are dynamically selected from a list, but recalculation occurs only after the last value is selected:

Sections[sect_name].Limits[limit_col].SuspendRecalculation = true;
Sections[sect_name].Limits[limit_col].SelectedValues.RemoveAll();
for(I = 1; I <= ListBox2.SelectedList.Count;I++)
{
  NewLimitValue = ListBox2.SelectedList[I];
  newname  +=  ListBox2.SelectedList[I]
  Sections[sect_name].Limits[limit_col].SelectedValues.Add(NewLimitValue);
}
Sections["Results"].Limits["1"].SuspendRecalculation = false;
Sections[sect_name].Limits[limit_col].Ignore=false; // Trigger recalculation now