$ListImg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
(Automatically generated page update)
Line 12: Line 12:
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.
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==
==Syntax==
<p class="syntax"><section begin="syntax" />[%RESULT =] $ListImg(list_identifier, image_id)
<p class="syntax">[%RESULT =] $ListImg(list_identifier, image_id)
<section end="syntax" /></p>
</p>
<p>
<p>
</p>
</p>

Revision as of 18:17, 10 April 2013

Associate an image with a $list

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.

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

[%RESULT =] $ListImg(list_identifier, image_id)

%result is a string that contains a 0, or it contains a negative number if an error has occurred.

-5 - Required argument not specified -6 - $List identifier invalid -8 - Image not found

$ListImg Error Codes

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.

Products authorizing $ListImg