Data validation

Data entered into fields by the dialog or input command may be tested for validity in three ways, which are listed below in the order in which they are performed:


Automatic validation. This relates to the field’s type and size and is performed by Sculptor whenever data is input into a field. It is only applicable to numeric fields. Typical examples would be an attempt to enter a number larger than 255 into a u1 type field, or to enter data into a day number type field (logical type dn) which did not conform to the field’s format (e.g. a month number greater than 12, or a number with no day/month/year separators). All date and time type fields, and other logical types, are fully checked for validity in this way. See Field types and sizes; Logical types.


Field validation list. An individual validation list may be attached to a field, specifying the acceptable values for input into the field. This is also automatically checked.


Validation function. A validation function is specified by means of the validate = clause. This is a textbox clause; the function is assigned to the textbox the field is linked to, not to the field itself. The clause specifies a function to be called in order to validate data input into the textbox. The validation function may be declared as a textbox clause:

+|- textbox box_id at x, y {
    validate = func_id

or may be assigned or altered at run time by means of the construction:

[window_id.]box_id->validate = func_id

By default, a validation function is only called if the input changes the content of the field. In order to force a field validation function to be called, whether the data in the textbox has changed or not, set the Sculptor system variable sys.AutoValidate to ON.


Textbox validation function

Field validation list

Field type and size