| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > RuleManager > Rule Class Methods >====== RuleIsBroken (test rule and return result) ====== | [[resetglobalrule clear address in globalrule .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[setglobalrule post address to globalrule .htm|{{btn_next_n.gif|Next page}}]] | | || **RuleIsBroken( **//display//** )** {{blk2blue.jpg|blk2blue.jpg}} | **RuleIsBroken** | Tests the rule and returns the result | | //Display// | An integer constant, variable, EQUATE, or expression that indicates whether to display an error indicator if the rule is broken. | The **RuleIsBroken **method uses EVALUATE to test SELF.Expression. If the result is zero, the rule is considered broken. Otherwise, the rule is considered sound. The method returns True if the rule is broken, False if not. If the value of //display// is non-zero, an error indicator is set using the SetIndicator method. **Implementation:** The RuleIsBroken method relies on the EVALUATE function to test a string containing an expression. Accordingly, all names used in the expression must be bound. If a procedure name is used, it must return a STRING, REAL or LONG value. If the procedures accept parameters, those paramaters must be STRINGs passed by value and may not be omittable. The RuleIsBroken method tests explicitly for errors related to the EVALUATE process and ignores errors which might be posted by called procedures. These procedures must therefore handle any errors which may be posted during their execution. The RuleIsBroken method calls SELF.SetGlobalRule before evaluating the expression and SELF.ResetGlobalRule immediately after evaluating the expression. During the EVALUATE process, then, a called procedure can use the address posted to call back to the current Rule instance. **Return Data Type:**     BYTE **Example:** | **RulesCollection.CheckAllRules Procedure(<;BYTE DisplayIndicator>)** | | **RetVal          LONG** | | **LBR             &Rule** | | **Counter         LONG** | | **Recs            LONG** | | **lIsBroken       BYTE** | | **    CODE** | | **    Recs    = SELF.RuleCount()** | | **    Retval  = 0** | | **    LOOP Counter = 1 TO Recs** | | **       LBR    &= SELF.Item(Counter)** | | **       lIsBroken= LBR.RuleIsBroken(DisplayIndicator)** | | **       RetVal +=lIsBroken** | | **    END** | | **    IF SELF.ChangeControlsStatus ** | | **       SELF.SetControlsStatus()** | | **    END** | | **    RETURN(RetVal)** | ** ** **See Also:** [[setglobalrule post address to globalrule .htm|SetGlobalRule]], [[resetglobalrule clear address in globalrule .htm|ResetGlobalRule]], [[setindicator set error indicator .htm|SetIndicator]]