The Value-checking tab is used to create, edit, save, and validate value-checking logic. Value-checking logic is used to constrain the value that an attribute (or type) can have. Although it is available for all attributes and types, it only applies to input from the user interface – attributes with their Direction property set to In or IO, and correspondingly, their owning classes must also have their PresentationType property set a value other than None.
Value-checking logic is evaluated as part of the automatic validation stage of the segment cycle, and an error is returned to the application client if the input value of the attribute is not validated successfully.
Value-checking logic is defined as conditional expressions evaluating the current value of the attribute (dynamically qualified as "this") against another value, which can be a set expression.
To open the Value-checking tab for an attribute or type, either:
Double-click the attribute or type in the Class View, Object Browser, or Members tab and then select the Value-checking tab.
Right-click the attribute or type in the Class View or Object Browser, click Go to Definition, and then select the Value-checking tab.
To set display, general, and tab options, refer to Setting Fonts and Colors. However, the only settings that affect the Value-checking tab are:
Line number color
Line number display
Tab size
Insert spaces and Keep tabs
Value-checking logic examples:
Example 1
This value-checking logic specifies that the value of the attribute must not be equal to 45, nor can it be greater than 90 (its value multiplied by 2 must be less than 180).
this NOT= 45 && this * 2 < 180
Example 2
This value-checking logic specifies that the value of the attribute must be greater than 0.
this > 0
Example 3
This value-checking logic specifies that the value of the attribute must be one of 'A', 'C', or 'Z'.
this in {"A", "C", "Z"}
Example 4
This value-checking logic specifies that the value of the attribute must not be one of 'A' or 'B'.
this NOT in {"A","B"}
Example 5
This value-checking logic specifies that the value of the attribute must be in the range 'A' to 'Z', but not one of 'M', 'N', or 'O'.
this in {"A" .. "Z"}-{"M" .. "O"}
Example 6
This value-checking logic specifies that the value of the attribute must be in the combined range of 'A' to 'Z' and 0 to 9.
this in {"A" .. "Z"} + {0 .. 9}