Using a Subfile

Although a Subfile is not accessible as a variable within PROIV, it behaves exactly like another File Variable to any 'parent' definition that contains it as an S-type field. If modified Subfile contents are to be saved, the parent record must be read before any Subfile records are read. PROIV internally ensures that parent records are written after Subfile records to allow usage of Subfiles as secondary files.

Example

This example shows the File Definitions for a Reality file and an associated Subfile, and the screen field and characteristics definitions that use these files.

The screenshot below shows the Reality File Definition, ACTIVITY, which contains details of the various activities at a sports centre.  One of the attributes, NUMATTS is a Subfile containing the number of attendees at each session of the activity; there are values (subrecords) for each session and, within each value, the number of attendees is held in two subvalues - one for the number of sports centre members and one for the number of non-members.

Screenshot shows the example ACTIVITY Reality File Definition

Note: The record length calculated by PROIV does not include any allowance for the contents of the Subfile.

Screenshot shows the example NUMATTS Subfile File Definition

 

Comment on this topic

Topic ID: 720273