Introduction to Navigational Programming › Testing Set Membership
Testing Set Membership
Using the IF function, users can test the following conditions associated with set membership:
- Whether a set occurrence is empty, that is whether there are member records in the set occurrence.
- Whether a record occurrence is a member of an occurrence of the set.
The IF function allows specification of the action to be taken when the result of the test is true. The following options of the IF function determine the condition to be tested:
- EMPTY- The test is true if the set occurrence identified by the current of set is empty. This test is typically made when positioned on an occurrence of the set's owner record type.
- NOT EMPTY- The test is true if the set occurrence identified by the current of set is not empty.
- MEMBER- The test is true if the current of run unit is a member in the specified set. This test is made when positioned on an occurrence of the set's member record type.
- NOT MEMBER- The test is true if the current of run unit is not a member in the specified set.
The following figure illustrates tests for an empty set condition. The routine locates each JOB in the ORG-DEMO-REGION and erases those whose JOB-EMPOSITION set is empty.
Copyright © 2013 CA.
All rights reserved.
|
|