$ListImg: Difference between revisions
m (misc cleanup) |
m (add italics) |
||
Line 8: | Line 8: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax">[%result =] $ListImg(list_identifier, image_id) | <p class="syntax">[<span class="term">%result</span> =] $ListImg(<span class="term">list_identifier</span>, <span class="term">image_id</span>) | ||
</p> | </p> | ||
<table> | <table> | ||
<tr><th>%result</th> | <tr><th>%result</th> | ||
<td>A string that contains a 0, or it contains a [[#Return codes| | <td>A string that contains a 0, or it contains a negative number (see [[#Return codes|Return codes]]) if an error has occurred. </td></tr> | ||
<tr><th>list_identifier</th> | <tr><th>list_identifier</th> |
Revision as of 17:41, 6 June 2018
Associate an image with a $list
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListImg function is BindImage.
The $ListImg function accepts two arguments and returns a numeric result: a 0 (indicating that the image has been associated with the $list) or a negative number (indicating that an error has occurred). It is a callable $function.
Syntax
[%result =] $ListImg(list_identifier, image_id)
%result | A string that contains a 0, or it contains a negative number (see Return codes) if an error has occurred. |
---|---|
list_identifier | A $list identifier. This is a required argument. |
image_id | A string containing the name of an image, or it can be any image item from the required image. This is a required argument. |
Return codes
-5 - Required argument not specified -6 - $List identifier invalid -8 - Image not found
Usage notes
- 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. - Functions that can use the association between an image and a $list are:
- 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.