A relational operator compares the user’s value to a set of possible values. Choose from these relational operators:
Depending on the relational operator you use, you can define a range set that is very large, or a set that contains a single value. When you use a relational operator, the value provided by the user is compared with the range defining value. If the comparison is true, the value is allowed and is assigned to the attribute. If the comparison is not true, the value is considered invalid and is not allowed. For example, assume you want to restrict the user to entering only positive numbers. In this case, you could define the range using either of the following clauses:
If the user enters a negative number (such as -1), these commands are false (-1 is not greater than -1 and is not greater than or equal to zero). Therefore the value is invalid. You might have an attribute with a few commonly entered values but that can actually be any value. To provide the user with the ability to select the commonly entered values from a menu, but also allow entry of any value, you would:
This syntax allows any value (except
When defining ranges for character strings, remember that you can also perform comparisons on them. Using the ASCII values for the characters, you can determine whether a character string has a higher or lower value than another character string. For example “Boy” is less than “boy” because uppercase letters are less than lowercase letters and “5boys” is less than “Boy” because numbers are less than uppercase letters. For more information on ASCII values, refer to an ASCII table. If the attribute value has a second part that was to start with the letters REV, you can use a pattern in the Range clause. For more information, see Range Compared with a Pattern (Special Character String) for the Add Attribute Command. |