$Occurs: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Mlarocca moved page $OCCURS to $Occurs: Lower case change)
m (misc formatting)
 
Line 1: Line 1:
<p>The $OCCURS function interprets a character string argument as a field name in the following manner:   </p>
<p>
The <var>$Occurs</var> function interprets a character string argument as a field name in the following manner: </p>
<ul>
<ul>
<li>In file context, $OCCURS returns 0 if the field description in the current file containing the specified field does not include the OCCURS field attribute. $OCCURS returns a number representing the number of specified occurrences if the field has OCCURS in its description.</li>
<li>In file context, <var>$Occurs</var> returns 0 if the field description in the current file containing the specified field does not include the <var>OCCURS</var> field attribute. <var>$Occurs</var> returns a number representing the number of specified occurrences if the field has <var>OCCURS</var> in its description. </li>
</li>
 
<li>In group context, $OCCURS returns 0 only when the field is described without an OCCURS attribute in every file making up the group. Otherwise, the function returns the minimum OCCURS specification included in all of the files.</li>
<li>In group context, <var>$Occurs</var> returns 0 only when the field is described without an <var>OCCURS</var> attribute in every file making up the group. Otherwise, the function returns the minimum <var>OCCURS</var> specification included in all of the files. </li>
</li>
 
<li>If the field specified as the $OCCURS argument is not defined in the current file or group, $OCCURS returns a value of -1. </li>
<li>If the field specified as the <var>$Occurs</var> argument is not defined in the current file or group, <var>$Occurs</var> returns a value of -1. </li>
</li>
</ul>
</ul>
<b>Example</b>
 
<p class="code">$OCCURS ('AGENT')
==Example==
<p>
The <var>$Occurs</var> result in the following statement is 1 if the definition of the <code>AGENT</code> field contains <code>OCCURS 1</code>:
</p>
</p>
<p>equals 1 if the description of AGENT contains OCCURS 1.    </p>
<p class="code">%n = $occurs('AGENT')
</p>
 
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Latest revision as of 00:10, 22 June 2018

The $Occurs function interprets a character string argument as a field name in the following manner:

  • In file context, $Occurs returns 0 if the field description in the current file containing the specified field does not include the OCCURS field attribute. $Occurs returns a number representing the number of specified occurrences if the field has OCCURS in its description.
  • In group context, $Occurs returns 0 only when the field is described without an OCCURS attribute in every file making up the group. Otherwise, the function returns the minimum OCCURS specification included in all of the files.
  • If the field specified as the $Occurs argument is not defined in the current file or group, $Occurs returns a value of -1.

Example

The $Occurs result in the following statement is 1 if the definition of the AGENT field contains OCCURS 1:

%n = $occurs('AGENT')