$ListInfI: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{DISPLAYTITLE:$ListInfI}}
{{DISPLAYTITLE:$ListInfI}}
<span class="pageSubtitle"><section begin="desc" />Retrieve $list item into image<section end="desc" /></span>
<span class="pageSubtitle">Retrieve $list item into image</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListInfI function is the [[GetImage (Stringlist subroutine)]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ListInfI function is the [[GetImage (Stringlist subroutine)]].</p>

Revision as of 21:21, 22 November 2011

Retrieve $list item into image

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

This function copies data from a specified $list item to an image.

The $ListInfI function accepts three 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 is the number of the item in the $list. This is a required argument.

The third argument can either be a string containing the name of an image or any image item from the required image. This is an optional argument if a image has been associated with the $list with a $ListImg function. Otherwise, it is a required argument.

Syntax

<section begin="syntax" /> [%RESULT =] $ListInfI(list_identifier, item_num, image_id) <section end="syntax" />

$ListInfI Function

%RESULT is a number that indicates whether or not an error has occurred.

One way to extract a $list item into an image called 'HEADSTONE' is as follows :

%RC = $ListInfI(%LIST, %N, 'HEADSTONE')

A more efficient way of doing this would be

%RC = $ListInfI(%LIST, %N, %HEADSTONE:ID)

The specific image item is irrelevant (as long as it is valid) in this call but is more efficient than specifying the image name in quotes because in the first example, the image name must be hashed and looked up (in NTBL) in each invocation of $ListInfI while in the second example, the hashing of the image name and lookup happens only once; at compile time.

An even neater and equally efficient way of coding this would be

%RC = $ListImg(%LIST, %HEADSTONE:FNAME) . . . . . . %RC = $ListInfI(%LIST, %N)

In this last example, $ListImg associates the image with the $list, eliminating the need to specify the image name on the $ListInfI. This association is also useful in many other function calls in that it provides a structure to be associated with the $list that is useful for column oriented functions such as $ListFindI and $ListSrt.

0 - Data successfully copied -5 - Required argument not specified -6 - $List identifier invalid -7 - Item number not found in $list -8 - Image not found or not active

$ListInfI Error Codes

Products authorizing $ListInfI