PreviousNextIndex

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
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.

r-avail.p
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)


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex