$ListOvlI: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Overlay part of $list item with image item<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Overlay part of $list item with image item<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListOvlI function is [[to be entered]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListOvlI function is the [[OverlayImageItem (Stringlist subroutine)]].</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.  


The $ListOvlI function accepts four arguments and always returns a 0. All errors cause the request to be cancelled. It is a callable $function (:hdref refid=callfun.).  
The $ListOvlI function accepts four arguments and always returns a 0. All errors cause the request to be cancelled. It is a callable $function (see [[Calling Sirius Mods $functions]]).  


The first argument is the identifier of the $list in which an item is to be updated. This is a required argument.  
The first argument is the identifier of the $list in which an item is to be updated. This is a required argument.  
Line 17: Line 15:


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.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListOvlI(list_identifier, item_num, -
<p class="syntax"><section begin="syntax" /> [%RESULT =] $ListOvlI(list_identifier, item_num, -
Line 24: Line 23:
</p>
</p>
<p class="caption">%RESULT is set to 0.</p>
<p class="caption">%RESULT is set to 0.</p>


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.  
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.  
Line 32: Line 30:
$ListOvlI is especially useful for $lists whose contents map to an image.
$ListOvlI is especially useful for $lists whose contents map to an image.
For example, in
For example, in
<p class="code"> IMAGE PRODUCT
<p class="code"> IMAGE PRODUCT
  CODE IS BINARY LEN 2
  CODE IS BINARY LEN 2
Line 40: Line 39:
   
   
  FR PRODUCTS
  FR PRODUCTS
%PRODUCT:CODE = CODE
    %PRODUCT:CODE = CODE
%PRODUCT:DESC = DESC
    %PRODUCT:DESC = DESC
%RC = $ListAddI(%LIST, %PRODUCT:CODE)
    %RC = $ListAddI(%LIST, %PRODUCT:CODE)
  END FOR
  END FOR
   
   
Line 52: Line 51:
  %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:DESC)
  %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:DESC)
</p>
</p>
The $list item associated with product code 983 has its description overlayed with a new description.  
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.
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
That is
<p class="code"> %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:CODE, 543)
<p class="code"> %NUM = $ListOvlI(%LIST, %NUM, %PRODUCT:CODE, 543)
</p>
</p>


is identical to
is identical to
<p class="code"> %TEMP = %PRODUCT:CODE
<p class="code"> %TEMP = %PRODUCT:CODE
  %PRODUCT:CODE = 543
  %PRODUCT:CODE = 543

Revision as of 15:51, 10 February 2011

<section begin="desc" />Overlay part of $list item with image item<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListOvlI function is the OverlayImageItem (Stringlist subroutine).

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 (see Calling Sirius Mods $functions).

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 third 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

<section begin="syntax" /> [%RESULT =] $ListOvlI(list_identifier, item_num, - image_item, overlay_value) <section end="syntax" />

$ListOvlI Function

%RESULT is set to 0.

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, in

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

%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

Products authorizing $ListOvlI