Skip to content

Status Command Component

Obsolete

Refer to the HasRecord function and Current_Record property of the DataDictionary class. If you are not using Data Dictionaries, you can use the DF_File_Status attribute.

Indicators are also obsolete, with the exception of predefined indicators that already exist in the language. Among the reasons for this is the limit of 89 user-defined indicators per program and that indicators are global.

Use the Boolean command to declare Boolean variables instead or declare properties in classes and objects. You can use the move command to set and retrieve the value of indicators.

See Also

Purpose

To indicate whether the buffer for a specific database file is active (contains an existing record for editing).

Syntax

indicate
indicator
status
df_filename
if status
df_filename statement

Argument Explanation

  • df_filename: The name of the database file whose status is to be checked.
  • statement: Any line of DataFlex code containing a command.

What It Does

Status df_filename may be used as though an indicator to set the values of other indicators or as an if test to control commands according to whether df_filename has the status of an active record in the buffer. A file's record buffer is active after a successful find and remains active until either it is cleared or a value is moved to its recnum.

indicate cust_found status customer

In this example, the indicator cust_found is set to true. This sets the indicator cust_found to true if an active record is in the customer record buffer. Otherwise, cust_found is set to false.

Note that the as normally used in indicate commands is not used with status.

if status customer gosub sale

In this example, the labeled subroutine sale is executed if the record buffer for database file customer contains an active record. Otherwise, the gosub is not executed.

Note that the if test for status contains no operator (e.g., eq active), as other if tests do.

Status may be thought of as a found indicator which you can query for any df_filename open in the program at any time, regardless of finds which may have been done in other files since the find or relate in other files.

Notes

  • The value of the predefined indicator found is set by the most recent find, regardless of what database file it was in. status, however, retains its value until a change (clear, delete, save) has occurred in the buffer for df_filename.