Type
Keyword

Purpose
The in operator tells DataEase to use a table other than the script's Primary table when executing a list records, delete records, modify records, or enter a record command.

Syntax
in TABLENAME|RELATIONSHIP
[named "UNIQUE RELATIONSHIP NAME" ]
[with ( selection criteria) ]

Usage
When the in operator is used without selection criteria, DataEase performs the action on all related records in the specified table. The in operator should not be used to process records in the script's Primary table (see the Caution below).
Example 1
for MEMBERS ;
modify records in RESERVATIONS
TOTALDUE := TOTALDUE - DISCOUNT .
end

This script discounts every related RESERVATIONS record each time a MEMBERS record is processed. Since every reservation is related to only one member, each record is discounted only once.
Example 2
for RESERVATIONS ;
modify records
TOTALDUE := TOTALDUE - DISCOUNT .
end

This script correctly modifies records in the Primary table. The in keyword is omitted from a list records, modify records, or delete records command when the action is performed on the Primary table.

Caution
Be careful not to use the following construction in a script:
for RESERVATIONS ;
modify records in RESERVATIONS
TOTAL DUE := TOTAL DUE - DISCOUNT .
end

This example demonstrates an incorrect use of the in operator. This script discounts every RESERVATIONS record each time a record is processed (i.e., each reservation is discounted as many times as there are records to process).