Progress
Language Reference


AVAILABLE Function

Interfaces
OS
SpeedScript
All
All
Yes

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

To access a record in a file defined for multiple databases, you might have to qualify the record’s filename with the database name. See the Record Phrase reference entry for more information.

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 item-num 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.item-num.
  FIND item USING item-num NO-ERROR.
  IF AVAILABLE item
  THEN DISPLAY item-name price.
  ELSE MESSAGE "Not found".
END. 

SEE ALSO

AMBIGUOUS Function, FIND Statement, FOR Statement, LOCKED Function, NEW Function


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