$ListOvlI: Difference between revisions
mNo edit summary |
No edit summary |
||
(14 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<span class="pageSubtitle">Overlay part of $list item with image item</span> | <span class="pageSubtitle">Overlay part of $list item with image item</span> | ||
<p class="warn"><b>Note: </b> | <p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListOvlI function is <var>[[OverlayImageItem (Stringlist subroutine)|OverlayImageItem]]</var>.</p> | ||
This function is used to overlay a $list item with the contents of an image item or a specified value at the offset of the image item in the image. This function returns an integer that indicates whether or not the operation was successful. | This function is used to overlay a $list item with the contents of an image item or a specified value at the offset of the image item in the image. This function returns an integer that indicates whether or not the operation was successful. | ||
Line 12: | Line 12: | ||
The second argument is the item number to be overlayed. This is a required argument. | The second argument is the item number to be overlayed. This is a required argument. | ||
The third argument is the image item that indicates the overlay offset and length and, if the | The third argument is the image item that indicates the overlay offset and length and, if the fourth argument is not specified, the value to be overlayed in the $list item. This is a required argument. | ||
The fourth argument is the value to be place at the image item's offset in the $list item. This is an optional argument. If this argument is not specified, the contents of the image item specified by argument three are used to overlay the $list item. | The fourth argument is the value to be place at the image item's offset in the $list item. This is an optional argument. If this argument is not specified, the contents of the image item specified by argument three are used to overlay the $list item. | ||
Line 20: | Line 20: | ||
</p> | </p> | ||
<p>%result is set to 0.</p> | <p><var class="term">%result</var> is set to 0.</p> | ||
==Usage notes== | ==Usage notes== | ||
Line 68: | Line 68: | ||
%PRODUCT:CODE = %TEMP | %PRODUCT:CODE = %TEMP | ||
</p> | </p> | ||
</ul> | |||
==Products authorizing {{PAGENAMEE}}== | ==Products authorizing {{PAGENAMEE}}== | ||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[List of $functions|Sirius functions]]</li> | ||
<li>[[Fast/Unload User Language Interface]]</li> | <li>[[Fast/Unload User Language Interface]]</li> | ||
<li>[[Janus Open Client]]</li> | <li>[[Media:JoclrNew.pdf|Janus Open Client]]</li> | ||
<li>[[Janus Open Server]]</li> | <li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li> | ||
<li>[[Janus Sockets]]</li> | <li>[[Janus Sockets]]</li> | ||
<li>[[Janus Web Server]]</li> | <li>[[Janus Web Server]]</li> | ||
<li> | <li>Japanese functions</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[Category:$Functions|$ListOvlI]] | [[Category:$Functions|$ListOvlI]] |
Latest revision as of 10:32, 20 May 2023
Overlay part of $list item with image item
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListOvlI function is OverlayImageItem.
This function is used to overlay a $list item with the contents of an image item or a specified value at the offset of the image item in the image. This function returns an integer that indicates whether or not the operation was successful.
The $ListOvlI function accepts four arguments and always returns a 0. All errors cause the request to be cancelled. It is a callable $function.
The first argument is the identifier of the $list in which an item is to be updated. This is a required argument.
The second argument is the item number to be overlayed. This is a required argument.
The third argument is the image item that indicates the overlay offset and length and, if the fourth argument is not specified, the value to be overlayed in the $list item. This is a required argument.
The fourth argument is the value to be place at the image item's offset in the $list item. This is an optional argument. If this argument is not specified, the contents of the image item specified by argument three are used to overlay the $list item.
Syntax
[%RESULT =] $ListOvlI(list_identifier, item_num, image_item, overlay_value)
%result is set to 0.
Usage notes
- A $ListOvlI will never change the length of a $list item. If the overlay string does not completely overlay a $list item, the characters after and before the overlay string remain unchanged.
- If the start column plus the length of the image item is greater than the current length of the $list item the request is cancelled.
- $ListOvlI is especially useful for $lists whose contents map to an image.
For example, given:
IMAGE PRODUCT CODE IS BINARY LEN 2 DESC IS STRING LEN 30 END IMAGE . . . FR PRODUCTS %PRODUCT:CODE = CODE %PRODUCT:DESC = DESC %RC = $ListAddI(%LIST, %PRODUCT:CODE) END FOR . . . %PRODUCT:CODE = 983 %NUM = $ListFindI(%LIST, %PRODUCT:CODE) %PRODUCT:DESC = 'Insertion widget' %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:DESC)
The $list item associated with product code 983 has its description overlayed with a new description.
If a value is specified in addition to the image item, processing is performed as if the value were assigned to the image item and then the image item restored to its original value. Any data type conversions required between the value and the image item are performed before the overlay is performed.
That is, the following:
%NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:CODE, 543)
is identical to:
%TEMP = %PRODUCT:CODE %PRODUCT:CODE = 543 %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:CODE) %PRODUCT:CODE = %TEMP