Relation Key Segment Loops

 

There are two special loop constructs that may be used within a relation loop. They are the "from key segment loop" and the "to key segment loop". These loops allow you to iterate through the key segments associated with the current relations "from key" and "to key".

 

Both of these loops behave just like a key segment loop within a key loop. All key segment loop expansion tokens and key segment loop expression tokens can be used in both of these loops. In addition for key segments associated with structure fields, you can also use field loop expansion tokens and field loop expression tokens.

 

FROM Key Segment Loops

 

From key segment loops allow you to iterate through the key segments associated with the key in the current structure that is identified as the relations FROM key.

 

They may be in a multi-line form:

 

<RELATION_LOOP>

[code]

<FROM_KEY_SEGMENT_LOOP>

code
</FROM_KEY_SEGMENT_LOOP>

[code]

</RELATION_LOOP>

 

Or an in-line form:

 

<RELATION_LOOP>

[code]

[code] <FROM_KEY_SEGMENT_LOOP> code </FROM_KEY_SEGMENT_LOOP> [code]

[code]

</RELATION_LOOP>

 

TO Key Segment Loops 

 

To key segment loops allows you to iterate through the key segments associated with the key in a different structure that is identified as the relations TO key.

 

They may be in a multi-line form:

 

<RELATION_LOOP>

[code]

<TO_KEY_SEGMENT_LOOP>

code
</TO_KEY_SEGMENT_LOOP>

[code]

</RELATION_LOOP>

 

Or an in-line form:

 

<RELATION_LOOP>

[code]

[code] <TO_KEY_SEGMENT_LOOP> code </TO_KEY_SEGMENT_LOOP> [code]

[code]

</RELATION_LOOP>

 

Restricted FROM Key Segment Loops

 

Restricted from key segment loops allow you to iterate through the key segments associated with the key in the current structure that is identified as the relations FROM key. The difference with the restricted form of the loop is that if the relations FROM key has more segments than (is longer than) the TO key, then not all segments of the FROM key will be processed. Processing will end when the cumulative length of the segments in the FROM key equals the total length of the TO key.

 

They may be in a multi-line form:

 

<RELATION_LOOP>

[code]

<FROM_KEY_SEGMENT_LOOP_RESTRICTED>

code
</FROM_KEY_SEGMENT_LOOP_RESTRICTED>

[code]

</RELATION_LOOP>

 

Or an in-line form:

 

<RELATION_LOOP>

[code]

[code] <FROM_KEY_SEGMENT_LOOP_RESTRICTED> code </FROM_KEY_SEGMENT_LOOP_RESTRICTED> [code]

[code]

</RELATION_LOOP>

 

Restricted TO Key Segment Loops 

 

Restricted to key segment loops allows you to iterate through the key segments associated with the key in a different structure that is identified as the relations TO key. The difference with the restricted form of the loop is that if the relations TO key has more segments than (is longer than) the FROM key, then not all segments of the TO key will be processed. Processing will end when the cumulative length of the segments in the TO key equals the total length of the FROM key.

 

They may be in a multi-line form:

 

<RELATION_LOOP>

[code]

<TO_KEY_SEGMENT_LOOP_RESTRICTED>

code
</TO_KEY_SEGMENT_LOOP_RESTRICTED>

[code]

</RELATION_LOOP>

 

Or an  in-line form:

 

<RELATION_LOOP>

[code]

[code] <TO_KEY_SEGMENT_LOOP_RESTRICTED> code </TO_KEY_SEGMENT_LOOP_RESTRICTED> [code]

[code]

</RELATION_LOOP>

 

 

 


Copyright © 2018  Synergex International, Inc.