Dealing with errors

Describes how to take advantage of the automatic error detection feature.

For this very first start with an OPL model, you have copied and pasted an existing model for quicker results. In your real business life, however, you will enter OPL statements from the keyboard. By default, the IDE checks for syntax and semantic errors automatically as you type and error messages are displayed in the Problems tab at the bottom of the IDE.

To observe the default behavior:

  1. In the second line of MyFirstProject.mod displayed in the Editing Area, remove the “s” from the end of the word “Resources”.
    Figure 1. A syntax error
    How a syntax error is indicated in the Editing Area

    The line containing the error is highlighted and for this line any other line affected by the error, a red error symbol appears in the margin A red circle with a white X in it, appearing in the grey margin of the Editing Area to indicate a syntax error in the model.. The Problems tab immediately displays the corresponding error messages, indicating the description, location, and source.

    Figure 2. Problems tab
    How the Problems tab displays a syntax error.
  2. Remove the mistake. The error message disappears and the indicators in the editor disappear.
  3. Press Ctrl+S or choose File > Save or press the Save button Save button in the standard toolbar to save your work.

In the next step, you will add two data files to the project.