HP 3000 Manuals

CLEAR Command [ HP ALLBASE/4GL Developer Reference Manual Vol. 2 ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Reference Manual Vol. 2

CLEAR Command 

The CLEAR command clears all or part of a screen or the scratch pad.

Formats 

      {*S [from_data_ref [to_data_ref]]         }
CLEAR {*P [from_data_ref [to_data_ref]]         }
      {*MAP map_from_data_ref [map_to _data_ref]}

Parameters 

from_data_ref, to_data_ref 

These fields are optional.  They define the extent to which the screen or
scratch pad is cleared.  They can be one of the following:

   *   Whole number.

   *   Numeric constant.

   *   Variable or calculated item.

   *   Screen field name.

   *   Scratch-pad field name.

   *   File record field reference.

   *   Work area field reference.

In the CLEAR command, you can specify a screen field by the field name,
and optionally omit the screen name.

map_from_data_ref, map_to_data_ref 

These fields specify the actual name(s) of the range of fields to be
cleared.  They can be one of the following:

   *   Screen field name.

   *   Scratch-pad field name.

Description 

The CLEAR command clears a single field, a range of fields, or all fields
on either the current screen or the scratch pad.  When used with a
screen, the CLEAR command clears both the screen display and the screen
field buffers for the field or fields specified in the command
parameters.

Two forms of the command are available.  The first form of the command
is:

CLEAR {*S} [from_data_ref [to_data_ref]]
      {*P}
This form of the CLEAR command identifies the extent of the fields to be
cleared by specifying either the field numbers or data references which
contain the numbers of the fields to be cleared.

     *S specifies that the clearing occurs on the current screen.}

     *P specifies that the clearing occurs in the scratch pad.}

If you don't specify any data references, HP ALLBASE/4GL clears the whole
screen or set of scratch pads.

If you only specify one data_ref, HP ALLBASE/4GL only clears one field.

If you specify both a from_data_ref and a to_data_ref, HP ALLBASE/4GL
clears that range of fields.  The range of fields cleared includes the
from_data_ref and to_data_ref fields.

The from and to values must either be numbers, or data references which
contain the field numbers to be cleared.

The second form of the CLEAR command is:

     CLEAR *MAP map_from_data_ref [map_to_data_ref]

This form of the CLEAR command identifies the extent of the fields to be
cleared by specifying the actual field names.  These names are then
mapped into their corresponding field positions.

The map_to_data_ref or map_from_data_ref is a required field.  That is,
at least one field must be cleared using this form of the command.

If you specify both map_from_data_ref and map_to_data_ref, HP ALLBASE/4GL
clears those fields and all fields between them.

If the fields you want to clear are scratch-pad fields, they must have
names assigned to them in the dictionary scratch-pad name declaration
screen.

Example 1 

     CLEAR *S

This command clears all fields on the current screen.

Example 2 

     CLEAR *P 2 V-last

This command clears fields in the scratch pad from field number 2 to the
field whose number is defined by the current value of the variable last.

Example 3 

     CLEAR *MAP P-Account_name

This command clears the scratch-pad field Account_name.

Using the *MAP option means the actual field Account_name is cleared and
not the field identified by the contents of Account_name.

Example 4 

     CLEAR *MAP S-Acct_name S-Closing_bal

This command clears the screen fields Acct_name and Closing_bal, and all
fields between them on the current screen.



MPE/iX 5.0 Documentation