$ListImg: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Associate an image with a $list<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Associate an image with a $list<section end="desc" /></span> | ||
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListImg function is [[ | <p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListImg function is the [[BindImage (Stringlist subroutine)]].</p> | ||
This function returns a 0 indicating that the image has been associated with the $list or a negative number indicating that an error has | This function returns a 0 indicating that the image has been associated with the $list or a negative number indicating that an error has occurred. | ||
The $ListImg function accepts two arguments and returns a numeric result. It is a callable $function ( | The $ListImg function accepts two arguments and returns a numeric result. It is a callable $function (see [[Calling Sirius Mods $functions]]). | ||
The first argument is a $list identifier. This is a required argument. | The first argument is a $list identifier. This is a required argument. | ||
Line 17: | Line 17: | ||
</p> | </p> | ||
<p class="caption">%RESULT is a string that contains a 0, or it contains a negative number if an error has occurred.</p> | <p class="caption">%RESULT is a string that contains a 0, or it contains a negative number if an error has occurred.</p> | ||
<p class="code"> | <p class="code"> | ||
-5 - Required argument not specified | -5 - Required argument not specified | ||
Line 24: | Line 25: | ||
<p class="caption">$ListImg Error Codes | <p class="caption">$ListImg Error Codes | ||
</p> | </p> | ||
Suppose there is an image with the following description: | Suppose there is an image with the following description: | ||
Line 33: | Line 33: | ||
END IMAGE | END IMAGE | ||
</p> | </p> | ||
One can associate this image with the $list %LIST with | One can associate this image with the $list %LIST with | ||
<p class="code"> %RC = $ListImg(%LIST, 'SALES') | <p class="code"> %RC = $ListImg(%LIST, 'SALES') | ||
</p> | </p> | ||
Line 39: | Line 41: | ||
<p class="code"> %RC = $ListImg(%LIST, %SALES:ID) | <p class="code"> %RC = $ListImg(%LIST, %SALES:ID) | ||
</p> | </p> | ||
While the latter is syntactically inefficient (<tt>:ID</tt> is superfluous), it is more efficient because the image name hashing and lookup is done at compile time rather than evaluation time. | While the latter is syntactically inefficient (<tt>:ID</tt> is superfluous), it is more efficient because the image name hashing and lookup is done at compile time rather than evaluation time. | ||
<li>th Functions that can use the association between an image and a $list are: | <li>th Functions that can use the association between an image and a $list are: | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>$ListAddI</th | <tr><th>[[$ListAddI]]</th></tr> | ||
<tr><th>[[$ListInf]]</th></tr> | |||
<tr><th>$ListInf</th | <tr><th>[[$ListInfI]]</th></tr> | ||
<tr><th>[[$ListInsI]]</th></tr> | |||
<tr><th>$ListInfI</th | <tr><th>[[$ListLoc]]</th></tr> | ||
<tr><th>[[$ListLup]]</th></tr> | |||
<tr><th>$ListInsI</th | <tr><th>[[$ListOvl]]</th></tr> | ||
<tr><th>[[$ListRepI]]</th></tr> | |||
<tr><th>$ListLoc</th | <tr><th>[[$ListSrt]]</th></tr> | ||
<tr><th>[[$ListSub]]</th></tr> | |||
<tr><th>$ListLup</th | </table> | ||
<tr><th>$ListOvl</th | |||
<tr><th>$ListRepI</th | |||
<tr><th>$ListSrt</th | |||
<tr><th>$ListSub</th | |||
The association between an image and a $list is an association between the image and the particular $list identifier value. A $ListMove does not change the image association of the target $list, and the image association of a $list is not saved or restored with $ListSav and $ListRst.<p> | The association between an image and a $list is an association between the image and the particular $list identifier value. A [[$ListMove]] does not change the image association of the target $list, and the image association of a $list is not saved or restored with $ListSav and $ListRst.<p> | ||
<ul class="smallAndTightList"> | <ul class="smallAndTightList"> | ||
Line 78: | Line 69: | ||
<li>[[Japanese functions]]</li> | <li>[[Japanese functions]]</li> | ||
<li>[[Sir2000 Field Migration Facility]]</li> | <li>[[Sir2000 Field Migration Facility]]</li> | ||
</ul> | |||
</ul> | |||
</p> | </p> | ||
<p class="caption">Products authorizing $ListImg | <p class="caption">Products authorizing $ListImg | ||
</p> | </p> | ||
[[Category:$Functions|$ListImg]] | [[Category:$Functions|$ListImg]] |
Revision as of 14:47, 10 February 2011
<section begin="desc" />Associate an image with a $list<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListImg function is the BindImage (Stringlist subroutine).
This function returns a 0 indicating that the image has been associated with the $list or a negative number indicating that an error has occurred.
The $ListImg function accepts two arguments and returns a numeric result. It is a callable $function (see Calling Sirius Mods $functions).
The first argument is a $list identifier. This is a required argument.
The second argument can be a string containing the name of an image, or it can be any image item from the required image. This is a required argument.
Syntax
<section begin="syntax" /> [%RESULT =] $ListImg(list_identifier, image_id) <section end="syntax" />
-5 - Required argument not specified -6 - $List identifier invalid -8 - Image not found
Suppose there is an image with the following description:
IMAGE SALES ITEM IS STRING LEN 16 ID IS STRING LEN 8 PRICE IS BINARY LEN 4 END IMAGE
One can associate this image with the $list %LIST with
%RC = $ListImg(%LIST, 'SALES')
or
%RC = $ListImg(%LIST, %SALES:ID)
While the latter is syntactically inefficient (:ID is superfluous), it is more efficient because the image name hashing and lookup is done at compile time rather than evaluation time.
$ListAddI |
---|
$ListInf |
$ListInfI |
$ListInsI |
$ListLoc |
$ListLup |
$ListOvl |
$ListRepI |
$ListSrt |
$ListSub |