PreviousNextIndex

VALIDATE statement

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

Syntax

VALIDATE record [ NO-ERROR ] 

record
NO-ERROR
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.ItemNum. 
  FIND Item USING Item.ItemNum NO-ERROR. 
  IF NOT AVAILABLE Item THEN DO: 
    CREATE iIem. 
    ASSIGN Item.ItemNum. 
    UPDATE Item.ItemName Item.Price. 
    VALIDATE Item. 
  END. 
  ELSE  
    DISPLAY Item.ItemName Item.Price. 
END. 

Notes
See also

IF...THEN...ELSE statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex