Device Functions - 1

693 Views


DSPFIL - Device Function

The Display File (DSPFIL) function defines a program to display a list of records from a specified file via a subfile.

The subfile is loaded one page at a time when the scroll keys are pressed.

The DSPFIL function also allows you to select specific field values within a file by using fields in the subfile control area of the panel.

For each field on the subfile record, an associated input-capable field is, by default, present on the subfile control area of the panel design.

Restrictor Parameters are only for key fields.

Specifying restricted key (RST) parameters to the DSPFIL function will restrict the records that will be written to the subfile for display. Only records from the based-on access path with key values that match exactly these values will be displayed. Restrictor parameters are output only.

Positioner Parameters are only for key fields.

The effect of positioner key fields is that only records from the based-on access path with key values greater than or equal to the specified positioner key values will be displayed in the subfile. Any key field that is defined to the DSPFIL function as an Input/Mapped parameter will act as a positioner for the subfile display.

A DSPFIL function can be attached to a Retrieval (RTV), Resequence (RSQ), or Query (QRY) access path.

The access path determines which records are displayed by this function.

Further selection of records can be made by specifying whether a record is to be selected in the appropriate point in the action diagram.

You cannot use a DSPFIL function to change or update records unless you add the specific logic to do so.

The DSPTRN function differs from the DSPFIL function in that DSPTRN loads an entire subfile. The DSPFIL function loads only one page of a subfile at a time.

DSPRCD - Device Function

The Display Record (DSPRCD) function defines a program to display a single record from a specified database file.

If you do not supply a key value to the function during execution, or if you supply only a partial key, a key value panel will prompt you for the key value(s).

After supplying the key value(s), the remaining fields in the record will appear. All or some of the keys can be supplied as restrictor parameters.

If the parameter list contains all the key fields as restrictors, the key panel will be bypassed. All fields on the DSPRCD panel design will be output capable only, by default.

You can attach a DSPRCD function to Retrieval (RTV) or Resequence (RSQ) access paths. The access path determines which fields and which records are available for display. There is no default update processing in this function.

The DSPRCD function executes in *DISPLAY mode only.

There are two display panels for this function type: a key panel which prompts for the key values and a detail panel which displays the remaining fields as defined by the device design and the access path.

The following is an example of a Key panel.

The following is an example of a Detail panel.

DSPRCD2 - Device Function

The Display Record (2 panels) (DSPRCD2) function defines a program that is identical to the Display Record function except that it allows the database record details to extend into two separate display device panels.

You can use the scroll keys to move between the panels of details.

This function type would be suitable to use with files that contain many fields.

The DSPRCD2 function executes in *DISPLAY mode only.

There are three display panels associated with this function type:

a key panel which prompts for the key values, and two detail panels which display, by default, all of the fields from the based-on access path.

On any panel, you can hide any fields that you do not want to appear. In addition, the same field can appear on more than one detail panel.

DSPRCD3 - Device Function

The Display Record (3 panels) (DSPRCD3) function defines a program that is identical to the Display Record function except that it allows the database record details to extend into three separate display device panels.

You may use the scroll keys to move between the panels of details.

This function type would be suitable to use with files that contain many fields.

The DSPRCD3 function executes in *DISPLAY mode only.

There are four display panels associated with this function type: a key panel, which prompts for the key values; and three detail panels, which display, by default, all of the fields from the based-on access path.

On any panel, you can hide the fields that you do not want to appear.

In addition, the same field can appear on more than one detail panel.

This panel is used to display a record that has more fields than currently fit into a single panel.

 

DSPTRN - Device Function

The Display Transaction (DSPTRN) function defines a program to display the records from two distinct but related database files.

The files must connect by a file-to-file relation.

The relation that connects the files must be an Owned by or a Refers to relation.

The DSPTRN function has two distinct record formats:

· a header, or master record format that corresponds to the owned by or referred to file and is in the subfile control portion of the panel

· a detail record format that corresponds to the owned by, referred to, or referring file and appears as a subfile

The DSPTRN function loads the entire subfile, and is suitable for using SUM, MIN, CNT, and MAX function fields.

A typical use of DSPTRN is to display an Order Header at the top of the panel with a subfile of the associated Order Details below.

The key fields in the header format will be input-capable. All non-key fields in the header format will be output only, by default.

All fields in the detail format will be output capable, by default.

If no key, or a partial key is supplied to the DSPTRN function, the key fields from header format will appear, prompting you for the remainder of the key in order to identify the file.

The DSPTRN function must be attached to a Span (SPN) access path.

The SPN access path connects two record formats with a common partial key. There is no default update processing for this function type.

In order to be able to create a Span access path,

· an Owned by or Refers to relation must exist between the header and the detail files

· the SPN access path must be created over the owning file or the referred to file

· the access path must be created explicitly to the SPN access path

EDTFIL - Device Function

The Edit File (EDTFIL) function defines a program to maintain records in a file, many at a time, using a subfile.

The subfile is loaded a page at a time when you press the scroll keys.

For each key field on the subfile record there will be an equivalent field on the subfile control header format.

Key fields can be used as positioner parameters in the subfile control format to specify which fields will be displayed in the subfile.

The subfile will have, by default, all records in the access path as input-capable.

Effects of Parameters

· If the high order keys are restrictor fields (RST), only records with keys matching the parameters will be displayed.

· If the high order keys are mapped positioner fields (POS), subfile records will be displayed on the first subfile page starting from the key values that you entered. If the subfile control field is output only or hidden, it will function as a restrictor field.

· Parameter fields that have a role of MAP will be placed on the subfile control format and not on the subfile record format.

An EDTFIL function can be attached to a Retrieval (RTV) or a Resequence (RSQ) access path.

An EDTFIL function contains calls to the Create Object, Delete Object, and Change Object functions if specified in the function options.

 

EDTRCD - Device Function

The Edit Record (EDTRCD) function defines a program to maintain records in a specified file, one record at a time. The EDTRCD function executes in either *ADD or *CHANGE mode.

There are two display panels for this function type: a key panel which prompts for the key values and a detail panel which displays all the fields from the based-on access path.

The EDTRCD function has the following default logic.

· It accepts the key panel (or key values if the key panel has been bypassed) and checks for record existence.

· In *ADD mode it displays a panel with blank input-capable fields if the record doesn’t exist.

· In *CHANGE mode it retrieves the record through a RTV or RSQ access path and displays the record as modifiable, input-capable fields

If no key value, or a partial key value, is supplied as a restrictor parameter, the key panel will prompt for the remainder of the key.

By specifying the elements of a composite key as restrictor (RST) parameters, the key panel will be bypassed and the function will exit when the record is changed and Enter is pressed.

The EDTCD function will be in *CHANGE mode when first called unless there are no records existing in the file. If you set the function option Dynamic program mode to Y, the function will automatically choose the correct mode.

You can toggle between *ADD and *CHANGE modes by pressing F9 on the key panel.

An EDTRCD function can be attached to a Retrieval (RTV) or a Resequence (RSQ) access path.

By default, an EDTRCD function contains calls to the CRTOBJ, DLTOBJ, and CHGOBJ functions.

EDTRCD2 - Device Function

The Edit Record (2 panels) (EDTRCD2) function is identical to the Edit Record function except that it allows the record details to extend to two separate display panels. You can use the scroll keys to move between the pages of detail.

This function type is suitable for files that contain many fields.

The EDTRCD2 function executes in either *ADD or *CHANGE mode.

There are three display panels for this function type: a key panel which prompts for the key values, and two detail panels, which display by default all of the fields from the based-on access path.

On any panel, you can hide fields that you do not want to appear. In addition, the same field can appear on more than one detail panel.

All of the considerations that apply to the Edit Record function also apply to EDTRCD2.

Post Comments