The buttons on the bottom have a different appearance depending on what has been done in the equation editor. Three common appearances are:
Changes made through the Equation Editor are applied incrementally to the model. Because of this, valid actions will depend on what you have done while in the Equation Editor, and the labeling and availability of the Dialog Control buttons reflect this.
OK/Close (Control-Enter or Control-W)
OK is the normal closing button for a dialog. It indicates that the changes you have made are to be kept and the dialog closed. When you click OK the equation you have entered is checked for syntax errors. If there are none, the dialog is closed.
If your equation has a syntax error, the error is reported. The OK button will change to a Close button. Clicking on Close forces the Equation Editor to close, even though the equation contains a syntax error. The variable will be marked as having a bad equation. The next time you open the Equation Editor on this variable, the error window will contain:
If you have clicked on the Check Model button discussed below and semantic errors have been found the OK button will be relabeled Close. Clicking on Close will close the Equation Editor. If the Check Model button was reporting semantic errors you will not be able to simulate the model, but you can continue to modify it and apply tools to it.
If the Check Model button was reporting only Use Flags and NOT DEFINED variables, you will be able to simulate the model. Note that to simulate a model with NOT DEFINED variables, you must load a dataset containing these variables (See Preparing, Using and Exporting Data).
Check Syntax (Control-K)
The Check Syntax button checks and internalizes the information you have entered for the current equation without closing the Equation Editor. When you have an equation with existing errors (the error line says Incorrect/Incomplete Equation), the Check Syntax button can be used to determine what and where the errors are. Note that in some cases an equation marked incorrect might not have a problem. This can happen if the cause of a variable is removed and then added back using the Sketch Editor.
Check Syntax will record all the changes you have made to the equation, comment, units, range, group, or supplementary status of the variable. What happens when you select it depends on whether or not there are syntax errors in the equation or units definition you have entered.
• | If there are no syntax errors, clicking on Check Syntax puts the message "Equation OK" in the Errors line. |
• | If there are syntax errors, clicking on Check Syntax will report the error in the Errors line and position you at the source of the error in the equation or units. |
Check Model
Click the Check Model button to internalize changes you have made to the current equation, and check for any semantic errors in the model. If the equation you are working on has been changed, the Check Model button first checks the current equations for syntax errors. If there are syntax errors, the Check Model button has the same effect as the Check Syntax button. You will be informed of and positioned at the error. If there are no syntax errors, the model will be checked for any semantic errors, variables that are not defined, and variables that are not used.
If there are any errors (syntax or semantic) or any USE FLAG or NOT DEFINED messages, the Equation Editor will stay open. The problems will be reported and you will be positioned at the source of the syntax error. If there are no syntax errors, you will be given the choice of a number of problems to review. See "Syntax Errors" and "Semantic Errors" below for more detail. If there are syntax errors the Check Model button will be grayed.
Delete Variable (Control-D)
The Delete Variable button deletes the variable you currently have in the Equation Editor from the model. This is a global change that will delete the variable from every view it appears in. You will be prompted to be sure you want to delete the variable.
Deletion of variables can be done in the Sketch Editor with the Delete tool. The Delete Variable button is provided as a convenience for situations in which the variable you want to delete does not appear on a view. You can, however, delete a variable with this button whether or not it appears on a view.
Cancel/Revert
Clicking on the Cancel buttons cancels any changes you made in the Equation Editor and closes the window without making changes to the model. The Equation Editor changes the model you are working on directly, and the Cancel button is available only before you have made changes to the model with the OK, Check Syntax, Check Model or Delete Variable buttons. The purpose of the Cancel button is largely to assure you that nothing has been changed and to allow you to escape from accidental keystrokes.
If you have made changes to the equation for a variable and ask to edit the equation for another variable, the Cancel button will be relabeled "Revert." Revert allows you to return an equation you are editing to the state it was in before any changes were made. The Revert button is available while you are making changes but before you use the OK, Check Syntax or Check Model buttons. Once you change the model relative to the equation you are working on, the Revert button is grayed.
Help (F1 or Control-H)
The Help button brings up a Help window with all of the manuals and reference materials that are distributed with Vensim.