Options Directive

DPL allows you to control the settings of compile-time options from a DPL program file. These options can be set within the Run Settings dialog or in DPL code. This feature can be very useful if forgetting to set an option results in long run times or unexpected results.

Like the #if, #else, and #include directives, the #options option list directive must begin in the first column of a line. In general, this directive should be used only once and near the beginning of a program file.

The option list consists of a sequence of letters separated by commas, indicating the options to be set. There are five compile-time options that can be set in an options directive:

  • e - (for expression optimization)
  • s - (for Fast Sequence Evaluation)
  • l - (for lottery optimization)
  • x - (Excel lookup function convention)
  • i - (ignore case when comparing strings)
If the letter is preceded by a minus sign, the option will be turned off. If the letter is preceded by a plus sign (or nothing) the option will be turned on. These settings override the settings in Home | Run. DPL will use the settings in the Home | Run | Options dialog to set options that are not included in the option list. The letters may be in either upper or lower case.

For example:

#options -e, +l

This will turn expression optimization off and turn lottery optimization on. In this example, series optimization would be controlled by the settings in Home | Run.

#options +x, +i

DPL will use Excel conventions when evaluating lookups and string comparisons.

#options -x, +i

DPL will use Lotus 1-2-3 conventions when evaluating lookups and string comparisons.

Versions: DPL Professional, DPL Enterprise, DPL Portfolio

See Also

Run Settings dialog

Compiler Directives

Converting Spreadsheets to DPL Code