AppendFieldImages (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:


<var>AppendFieldImages</var> is a <var>Stringlist</var> variant of <var>[[$Field_ListI]]</var>. <var>AppendFieldImages</var> has the same parameters as <var>$Field_listI</var>, except they are [[Notation conventions for methods#Named parameters|name required]] parameters.
<var>AppendFieldImages</var> is a <var>Stringlist</var> variant of <var>[[$Field_ListI]]</var>. <var>AppendFieldImages</var> has the same parameters as <var>$Field_listI</var>, except they are [[Notation conventions for methods#Named parameters|name required]] parameters.


==Syntax==
==Syntax==
Line 12: Line 11:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%count</th>
<tr><th>%count</th>
<td>This numeric variable is the number of items (extracted repeating group occurrences) added to <var>Stringlist</var> <var class="term">sl</var>, or it is a (negative) status code.</td></tr>
<td>This numeric variable is the number of items (extracted repeating group occurrences) added to <var>Stringlist</var> <var class="term">sl</var>, or it is one of these status codes:
<table>
<tr><th><var>>= 0</var> </th>
<td>Number of repeating group occurrences extracted </td></tr>
<tr><th>&nbsp;&nbsp;&nbsp;&nbsp;<var>-3</var></th>
<td>CCATEMP full</td></tr>
<tr><th><var>< -100</var></th>
<td>Negative of (repeating group occurrences extracted + 100), when partial groups found</td></tr>
</table>
All other errors result in request cancellation. </td></tr>


<tr><th>sl</th>
<tr><th>sl</th>
<td>A <var>Stringlist</var> object.</td></tr>
<td>A <var>Stringlist</var> object. If empty, data is added to the end of the <var>Stringlist</var>. </td></tr>


<tr><th><var>Image</var></th>
<tr><th><var>Image</var></th>
<td>string</td></tr>
<td>This optional, [[Notation conventions for methods#Named parameters|name required]], argument is a string containing the name of an image and, optionally, an item in the image separated from the image name with a colon. The image and optional image item name can be separated with a blank from an optional fieldname prefix. If an image item name is specified, that item will be set to the occurrence number retrieved.
 
If this argument is not specified, or is null, or is simply a colon followed by an image item name, the image bound to <var>Stringlist</var> <var class="term">sl</var> via <var>[[BindImage (Stringlist subroutine)|BindImage]]</var> is used as the mapping image. The specified image must have been defined with the <var>NAMESAVE</var> option. Also, the image is not allowed to have arrays, cannot have more than 255 items, and cannot be more than the maximum length of <var>Stringlist</var> items (2**31-1 bytes).
 
The names of the image items in the specified image are mapped to fields in the current record context, and then the values of those fields are moved into the image. </td></tr>


<tr><th><var>FirstOccurrence</var></th>
<tr><th><var>FirstOccurrence</var></th>
<td>number</td></tr>
<td>This optional, name required, argument is the first occurrence number of the repeating group to return. This defaults to 1, meaning that the first occurrence of the repeating group will be returned.</td></tr>


<tr><th><var>MaxOccurrences</var></th>
<tr><th><var>MaxOccurrences</var></th>
<td>number</td></tr>
<td>This optional, name required, argument is the maximum number of occurrences of the repeating group to return. This defaults to 0, meaning that all occurrences of the repeating group, including and after the one specified by the <var>FirstOccurrence</var> argument, will be returned.</td></tr>


<tr><th><var>Options</var></th>
<tr><th><var>Options</var></th>
<td>string</td></tr>
<td>This optional, name required, argument is a string that is a set of blank-delimited options to affect <var>AppendFieldImages</var> processing. The valid options are:
 
<table class="syntaxTable">
<tr><th><var>MissCan</var></th>
<td>Cancel the request if not all image items map to field names. If an occurrence count item is specified in the <var>Image</var> argument, that item does not have to map to a field name (if it does the field value will not be retrieved anyway). This is the default.</td></tr>
 
<tr><th><var>NoMissCan</var></th>
<td>Don't cancel the request if not all image items map to field names. Specify <var>NoMissCan</var> if there are image items in the image that are not associated with fields.</td></tr>
 
<tr><th><var>PartCan</var></th>
<td>Cancel the request if not all image items that map to fields return the same number of occurrences. This is the default.</td></tr>
 
<tr><th><var>NoPartCan</var></th>
<td>Don't cancel the request if not all image items that map to fields return the same number of occurrences. If <var>NoPartCan</var> is set, and some image items that map to field occurrences return different numbers of occurrences, the return code from <var>AppendFieldImages</var> will be the negative of (the number of occurrences returned plus 100). For example, if a partial group is found but 55 occurrences were returned, the return code would be set to -155.
</td></tr>
</table>
 
In group context, the <var>MissCan</var>/<var>NoMissCan</var> setting applies based on whether the fields are defined in the group, that is, in any file in the group. If some fields that map to image items are not found in all files in group context, <var>NoPartCan</var> must be specified if any fields are to be retrieved.</td></tr>


<tr><th><var>NullValue</var></th>
<tr><th><var>NullValue</var></th>
<td>string</td></tr>
<td>This optional, name required, argument is a string</td></tr>
</table>
</table>



Revision as of 21:58, 6 July 2012

Add fields stored in image format to a Stringlist (Stringlist class)

[Introduced in Sirius Mods 7.8]


This callable function retrieves fields that are in repeating groups into Stringlist items mapped to a User Language image.

AppendFieldImages is a Stringlist variant of $Field_ListI. AppendFieldImages has the same parameters as $Field_listI, except they are name required parameters.

Syntax

[%count =] sl:AppendFieldImages[( [Image= string], [FirstOccurrence= number], - [MaxOccurrences= number], - [Options= string], [NullValue= string])]

Syntax terms

%count This numeric variable is the number of items (extracted repeating group occurrences) added to Stringlist sl, or it is one of these status codes:
>= 0 Number of repeating group occurrences extracted
    -3 CCATEMP full
< -100 Negative of (repeating group occurrences extracted + 100), when partial groups found
All other errors result in request cancellation.
sl A Stringlist object. If empty, data is added to the end of the Stringlist.
Image This optional, name required, argument is a string containing the name of an image and, optionally, an item in the image separated from the image name with a colon. The image and optional image item name can be separated with a blank from an optional fieldname prefix. If an image item name is specified, that item will be set to the occurrence number retrieved.

If this argument is not specified, or is null, or is simply a colon followed by an image item name, the image bound to Stringlist sl via BindImage is used as the mapping image. The specified image must have been defined with the NAMESAVE option. Also, the image is not allowed to have arrays, cannot have more than 255 items, and cannot be more than the maximum length of Stringlist items (2**31-1 bytes).

The names of the image items in the specified image are mapped to fields in the current record context, and then the values of those fields are moved into the image.
FirstOccurrence This optional, name required, argument is the first occurrence number of the repeating group to return. This defaults to 1, meaning that the first occurrence of the repeating group will be returned.
MaxOccurrences This optional, name required, argument is the maximum number of occurrences of the repeating group to return. This defaults to 0, meaning that all occurrences of the repeating group, including and after the one specified by the FirstOccurrence argument, will be returned.
Options This optional, name required, argument is a string that is a set of blank-delimited options to affect AppendFieldImages processing. The valid options are:
MissCan Cancel the request if not all image items map to field names. If an occurrence count item is specified in the Image argument, that item does not have to map to a field name (if it does the field value will not be retrieved anyway). This is the default.
NoMissCan Don't cancel the request if not all image items map to field names. Specify NoMissCan if there are image items in the image that are not associated with fields.
PartCan Cancel the request if not all image items that map to fields return the same number of occurrences. This is the default.
NoPartCan Don't cancel the request if not all image items that map to fields return the same number of occurrences. If NoPartCan is set, and some image items that map to field occurrences return different numbers of occurrences, the return code from AppendFieldImages will be the negative of (the number of occurrences returned plus 100). For example, if a partial group is found but 55 occurrences were returned, the return code would be set to -155.
In group context, the MissCan/NoMissCan setting applies based on whether the fields are defined in the group, that is, in any file in the group. If some fields that map to image items are not found in all files in group context, NoPartCan must be specified if any fields are to be retrieved.
NullValue This optional, name required, argument is a string

Usage notes

See also