How To |
You can provide range checking for minimum and maximum values for specific data types that you include in a class DFA file. When a user instantiates the class, an error message displays if the parameter values are outside the range. The range also displays in the status line when you select the parameter from the Add/Edit Child Rule dialog or Add/Edit Child List Rule dialog.
Parameter range checking is supported for the following data types:
Integer
Number
String
To use range checking, you define additional attributes of the form "xx_max" and "xx_min" where xx is the parameter name on which to perform checking.
#! UG/KF 17.0 DefClass: test_param (ug_base_part);
(number parameter) len: 5; (number) len_max: 8;
(number) len_min: 4; (string parameter) tom: "Bobby";
(string) tom_max: 6;
(string) tom_min: 4; (Child) mybox: { Class; ug_block; length; len:; };
In the above example, the len parameter cannot be smaller than 4 or greater than 8. The tom parameter cannot be less than 4 characters nor greater than 6 characters.
If you wish to only check the minimum or maximum, then only create the attribute for the required end range.