TCE starts a rule check when an object or feature of a class has changed in the object structure, where the Check Rules on Change or Rules switch is turned on and the size of the function stack drops back to zero or to an entry in which the interpreter is waiting for execution to continue (modal forms or message windows (MsgBox). Even if a feature has changed its value, e.g. by a user input, where the function stack is not used, the rules are checked immediately. Finally, the rules are checked when the Server.CheckRules function is called or global properties such as the dialog language or dialog currency have been changed.
A single rules check consists of the following components:
- Checking assignments by assignment rules, delete rules, assignment/delete rules
- Checking the decisions (for all objects and features)
- Checking excel sheets managed by sheet variables
- Checking decision tables, event rules of functions and class updates for all objects
This rule checking operation of value-setting rules and constructs continues until a final rule check no longer results in any changes to the values and state of all elements of the object tree.
After checking changes to values, the validity status of the variables is checked. Only variables whose property Rules is set will be checked.
In rare cases, this check can still result in changes in value. If this is the case, the review will be fully restarted.
TCE then checks which form contents need to be updated. These forms or control elements are submitted to the client. All variables and expressions that are entered in the properties of forms and controls are taken into account. Menus and toolbars are also checked and updated.
If, after reaching Server.RuleLoopLimit (default 500), rule passes do not reach a consistent state, or if a rule check changes the value of one variable more than Server.RuleToggleLimit (default value: 200) times, the interpreter stops with an error message 758 "Endless loop during rule checking".