Navigation: Templates > Template Language Reference > Complete Alpha Listing >====== #VALIDATE (validate prompt input) ====== | |
#VALIDATE( expression,message )
#VALIDATE | Validates the data entered into the immediately preceding #PROMPT field. |
expression | The expression to use to validate the entered data. |
message | A string constant containing the error message to display if the data is invalid. |
The #VALIDATE statement validates the data entered into the #PROMPT field immediately preceding the #VALIDATE. The expression is evaluated when the OK button is pressed on the Procedure Properties window. If the expression is false, the message is displayed to the programmer in a message box, and control is given to the #PROMPT field that immediately precedes the #VALIDATE. There may be multiple #VALIDATE statements following a #PROMPT to validate the entry. A #PREPARE structure may follow a #PROMPT prior to the #VALIDATE, but no other template statements are valid between #PROMPT and #VALIDATE, including template comments.
Example:
#PROMPT('Input Value, Even numbers from 100-200',@N3),%Value
#VALIDATE1), %ChangeDateGroup,REQ
#PREPARE
#FIX(%File,%Primary)
#FIX(%Field,%ChangeDateGroup)
#ENDPREPARE
#VALIDATE(%FieldType = 'GROUP','Change Date Group must be of type GROUP!')
See Also: #PROMPT