Procedure Overview

When you define a new procedure body, you must set up its description, type and other fundamental properties in the procedure overview using the dialog below:

Description

Enter a brief description of the procedure body. Initially the description from the procedure is copied to this field, but you may change it if you wish; the procedure and procedure body descriptions are independent.

Procedure Type

Select the required procedure type from the menu. The types are as follows:

Procedure Body Type  Description
Interactive Data entry procedure
Batch Procedure without data entry or printing.
Menu Procedure offering the user a choice of actions from a simple menu without pull-downs
Print Procedure to send output to a print device
Combined menu/entry Data entry procedure terminated using a function key to select an action
Action bar menu Procedure offering the user a choice of actions from a menu with pull-downs
Save/exit menu Procedure to confirm or abandon changes before the database is updated - for programs where the private database facility is being used
Sub device output Procedure to select or print to a different sub device, and for multi-output devices
Device select/print Procedure to select an output device interactively, at run-time
Run another program Procedure to call another QA Build program, non-QA Build program, or use a set of built-in commands
Link to C Procedure which selects a procedure body written in C
Hot key set up Procedure to set up hot key actions which can be called when executing subsequent procedures

The links in the table above will help you fill in the remaining fields in this dialog as appropriate for that procedure type.

Depending on the program type, and the procedures above this one in your procedure tree, some procedure types may be disabled.

Output sub-device

This field is only used for procedure bodies of types Device select/print and Sub device output.

Input sub-device

Enter (as an integer) the required bit mask for input devices. Press <Ctrl+P> to choose from the available input devices.

Escape option

In some menus you may wish to prevent the user from escaping by pressing <Esc> or you may wish to perform some special processing when <Esc> is pressed. You can do this by forcing the <Esc> key to be treated as a regular option number. If you do this, however, ensure that you set a condition to repeat for the procedure, so that the user has a way out.

Mapnames

Each procedure body can use maps from two distinct mapsets:

Either or both mapnames can be blank, in which the name used is inherited from the procedures above. You may use the same mapset for both groups of map if you wish. More information and advice on using mapnames can be found in Mapsets and QAB.

Main mapname

Enter the name of the main mapset to be used by this procedure. If you leave this field blank, the procedure will inherit the mapset name from the procedure above (or the mapset name it inherited) , and so use the same mapset as it. If mapnames are blank all the way to the top of the procedure tree the program name is used as a mapset. A blank mapname is useful when the same procedure body is used in several programs but with minor differences, such as headings, in the maps. The mapset name that will be inherited is displayed at the top of the screen, to the left of the information about programs that are affected by changes to the procedure.

If you enter the name of a mapset, that mapset will be loaded. This is useful if the procedure always uses the same maps; it also simplifies maintenance.

Remarks mapname

The Remarks mapname is treated similarly to the main mapname - if it is blank, it is inherited from See the notes on Main mapname above. If you leave this field blank, the procedure will use the currently loaded mapset. You may, however, prefer to keep all your messages in a special mapset shared by all programs to ensure, for example, consistency of error messages.

Database procedure

Enable this option if the procedure uses the database. Disable this option only if the procedure does not access or update any tables. The most likely use of such non-database procedures is as pause routines and to display headings. (Non-database procedures, however, may refer to previously defined database fields.)

Update database

Enable this option if this procedure updates or deletes any records in the database.

Confirm updates

Enable this option if the user is required to confirm that the data is correct before the database is updated.

Secure changes

Enable this option if you wish to ensure that changes made up to this point in the program will be preserved in the event of a crash. Think carefully about your answer because disabling this option may mean that transactions are lost in a crash, while enabling it will slow the program down. Usually you should enable the option at the top level of a multi-level program, but disable it in batch update programs.

Repeated procedure

Enable this option if you require the procedure to repeat until either the user selects an escape option (in an interactive program) or there are no more records to process (in a batch program). Be careful not to repeat procedures such as heading routines which do not access the database, unless they are interactive or a condition to repeat is set.

Condition to repeat

Enable this option if the procedure is repeated but you wish to make the repetition conditional. Select the condition from the Formula Editing Menu .

Error subsidiaries

Normally subsidiary procedures are not executed if the user chooses to delete the record being processed, if there is a checkpoint failure or if the record cannot be processed. Enable this option if you wish to execute subsidiaries even under these circumstances. You must, however, ensure that there are suitable entry conditions on each subsidiary.

Command

If the procedure is of the Run another program type, enter the command line for the program you want to run. You can find full information on the command syntax in Running Other Programs and Special Commands.