$ImgInf: Difference between revisions
(Created page with "{{DISPLAYTITLE:$ImgInf}} <span class="pageSubtitle"><section begin="desc" />Retrieve image item by variable name<section end="desc" /></span> <p class="warning">Most Sirius $fun...") |
m (1 revision) |
(No difference)
|
Revision as of 15:45, 31 January 2011
<section begin="desc" />Retrieve image item by variable name<section end="desc" />
Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $ImgInf function is to be entered.
This function returns a string containing the current value of a specified image item. All errors cause request cancellation.
The $ImgInf function accepts two arguments and returns a string result.
The first argument is either a string that contains an image name or any image item in the source image. If an image item is specified, only the image portion is relevant for this function since the second argument indicates the actual item from which data is to be extracted. Nevertheless, it is more efficient to specify an image item rather than an image name unless the image name itself is to be variable at run time. This is because an image name must be hashed and then NTBL must be searched for the hash value, both moderately expensive operations. This is a required parameter.
The second argument is a string that contains the name of the image item from which the value is to be retrieved. This is a required parameter.
Syntax
<section begin="syntax" /> %RESULT = $ImgInf(image_identifier, item_name) <section end="syntax" />
$ImgInf is provided to get around the fact that Model 204 has no support for image name variables in the way it has support for screen name variables. That is, if the image or image item from which data is to be extracted is unknown at compile time, $ImgInf can be used to retrieve the image data based on values set at evaluation time.
For example
%NAME = $ImgInf(%RECTYPE, 'NAME')
extracts the value of an image item called "NAME" from the image associated with the variable %RECTYPE.
%DATA = $ImgInf(%BIGIMG:ID, %FIELD)
extracts the value of an image item whose name is indicated by %FIELD from the image BIGIMG.
Obviously, if both image and item name are knowd at evaluation time a simple assignment should be performed as in
%DATA = %BIGIMG:CUSTID