Skip to content

Required Field Property

Obsolete

Refer to the Field Options property in the DataDictionary class.

Purpose

To prevent the cursor from leaving an item attached to a field until data has been entered.

Syntax

set field_options field file.field to dd_required

or

entry_item file.field [
    {required
    [, ..., option]}
]

What It Does

The Required property checks whether data has been entered into the current item and keeps the cursor in that item until either data has been entered or the Exit Application accelerator key has been pressed, terminating the program. As long as Exit Application is used for its normal purpose of aborting the program and closing any open files, this will cause no problems. Leaving the item by any other means without entering data results in Error 13: "An entry is required on this window."

The usual way of applying this property to a field would be in a DataDictionary object using the field_options property, so that this behavior would be manifested by every item addressing file.field in every DEO using the DataDictionary.

set field_options field trucks.id to dd_required

In this example, the cursor is kept in every item attached to Field.id in File trucks until data has actually been entered from the keyboard. This property can also be applied on an exception basis through a specific DEO by placing required on the entry_item statement.

entry_item trucks.id {required}

In this example, the cursor is kept in an item attached to Field.id in File trucks until data has actually been entered from the keyboard.

Notes

  • Any character or characters entered into the item will allow the cursor to move on to the next item.

  • Only Exit Application will allow users to exit a required field without data, and it will normally terminate the program running.

  • You cannot trap Error 13: "An entry is required on this window" by required or any other means for use in on error gosub.