Specifications

CHAPTER 8 Displaying and Validating Data
Users Guide 293
3 (Optional) Enter a string or string expression to customize the validation
error message.
For more information, see “Customizing the error message” on page 291.
Specifying the expression
Since a user might have just entered a value in the column, validation rules
refer to the current data value, which you can obtain through the
GetText
InfoMaker expression function.
Using
GetText ensures that the most recent data entered in the current column
is evaluated.
InfoMaker does the conversion for you
If you have associated a validation rule for a column in the Database painter,
InfoMaker automatically converts the syntax to use
GetText when you place the
column in a form.
GetText returns a string. Be sure to use a data conversion function (such as
Integer or Real) if you want to compare the entered value with a datatype other
than string.
For more on the
GetText function and text patterns, see Chapter 24,
“DataWindow Expression and InfoMaker Functions.”
Referring to other
columns
You can refer to the values in other columns by specifying their names in the
validation rule. You can paste the column names in the rule using the Columns
box.
Examples
Here are some examples of validation rules.
Example 1 To check that the data entered in the current column is a positive
integer, use this validation rule:
Integer(GetText( )) > 0
Example 2 If the current column contains the discounted price and the
column named
Full_Price contains the full price, you could use the following
validation rule to evaluate the contents of the column using the
Full_Price
column:
Match(GetText( ),"^[0-9]+$") AND
Real(GetText( )) < Full_Price