Progress
Language Reference


VALIDATE Statement

Interfaces
OS
SpeedScript
All
All
Yes

Verifies that a record complies with mandatory field and unique index definitions.

SYNTAX

VALIDATE record [ NO-ERROR ] 

record

The name of the record you want to validate.

To validate a record in a table defined for multiple databases, you must qualify the record’s table name with the database name. See the Record Phrase reference entry for more information.

NO-ERROR

Specifies that any errors that occur in the attempt to validate the record are suppressed. After the VALIDATE statement completes, you can check the ERROR-STATUS system handle for information on any errors that occurred.

EXAMPLE

This procedure prompts for an item number. If an item with that number is not available, the procedure creates a new item record and lets you supply some item information. The VALIDATE statement checks the data you enter against the index and mandatory field criteria for the item record.

r-valid.p
REPEAT FOR item:
  PROMPT-FOR item-num.
  FIND item USING item-num NO-ERROR.
  IF NOT AVAILABLE item THEN DO:
    CREATE item.
    ASSIGN item-num.
    UPDATE item-name price.
    VALIDATE item.
  END.
  ELSE DISPLAY item-name price.
END. 

NOTES

SEE ALSO

IF...THEN...ELSE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095