Previous Next

AVAILABLE function
Returns a TRUE value if the record buffer you name contains a record and returns a FALSE value if the record buffer is empty.
When you use the FIND statement or the FOR EACH statement to find a record, the AVM reads that record from the database into a record buffer. This record buffer has the same name as the file used by the FIND or FOR EACH statement, unless you specify otherwise. The CREATE statement creates a new record in a record buffer.
Syntax 
 
AVAILABLE record
record
The name of the record buffer you want to check.
Note:
Example 
In this procedure, the FIND statement with the NO-ERROR option bypasses the default error checking and does not display the message you get. Because ItemNum is unique, you do not have to use the AMBIGUOUS function to pinpoint the cause of a record not being AVAILABLE.
 
REPEAT:
  PROMPT-FOR Item.ItemNum.
  FIND Item USING ItemNum NO-ERROR.
  IF AVAILABLE Item THEN 
    DISPLAY Item.ItemName Item.Price.
  ELSE 
    MESSAGE "Not found".
END.
See also 
AMBIGUOUS function, FIND statement, FOR statement, LOCKED function, NEW function (record buffers)

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.