GetImage (Stringlist subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (better tagging all the time)
m (tag, usage notes, example)
Line 12: Line 12:
<td>The number of the item in the <var>Stringlist</var>. </td></tr>
<td>The number of the item in the <var>Stringlist</var>. </td></tr>
<tr><th>imageName</th>
<tr><th>imageName</th>
<td>A string that contains the name of an image. This is an optional argument if an image has already been associated with the <var>Stringlist</var> via [[BindImage (Stringlist function)|BindImage]]. Otherwise, it is a required argument. <b><i>This argument is case sensitive</i></b>.  That is, in the likely event the User Language was written in mixed case, with automatic uppercasing in effect (see [[Mixed-case User Language]]) the image name should be in uppercase.</td></tr>
<td>A string that contains the name of an image. This is an optional argument if an image has already been associated with the <var>Stringlist</var> via [[BindImage (Stringlist function)|BindImage]]. Otherwise, it is a required argument. <b><i>This argument is case sensitive</i></b>.  That is, in the likely event the User Language was written in mixed case, with automatic uppercasing in effect (see [[Mixed-case User Language]]) the image name should be in <b><i>uppercase</i></b>.</td></tr>
</table>
</table>


Line 18: Line 18:
<ul>
<ul>
<li>All errors in <var>GetImage</var> result in request cancellation.
<li>All errors in <var>GetImage</var> result in request cancellation.
<li>One way to extract a <var>Stringlist</var> item into an image (called <code>Headstone</code>, below) is as follows:
</ul>
 
==Examples==
<ol><li>One way to extract a <var>Stringlist</var> item into an image (called <code>Headstone</code>, below) is as follows:


<p class="code">%list:getImage(%n, 'HEADSTONE')
<p class="code">%list:getImage(%n, 'HEADSTONE')
</p>
</p>


Here is a neater and more efficient way of doing this:
<li>Here is a neater and more efficient way of doing this:


<p class="code">%list:bindImage('HEADSTONE')
<p class="code">%list:bindImage('HEADSTONE')
Line 31: Line 34:


In this last example, the [[BindImage (Stringlist function)|BindImage]] associates the image with the <var>Stringlist</var>, eliminating the need to specify the image name on the <var>GetImage</var>.
In this last example, the [[BindImage (Stringlist function)|BindImage]] associates the image with the <var>Stringlist</var>, eliminating the need to specify the image name on the <var>GetImage</var>.
</ul>
</ol>


==See also==
==See also==
{{Template:Stringlist:GetImage footer}}
{{Template:Stringlist:GetImage footer}}

Revision as of 00:55, 29 January 2011

Retrieve Stringlist item into image (Stringlist class)


This method copies data from a specified Stringlist item to an image.

Syntax

sl:GetImage( itemNum, [imageName])

Syntax terms

sl A Stringlist object.
itemNum The number of the item in the Stringlist.
imageName A string that contains the name of an image. This is an optional argument if an image has already been associated with the Stringlist via BindImage. Otherwise, it is a required argument. This argument is case sensitive. That is, in the likely event the User Language was written in mixed case, with automatic uppercasing in effect (see Mixed-case User Language) the image name should be in uppercase.

Usage notes

  • All errors in GetImage result in request cancellation.

Examples

  1. One way to extract a Stringlist item into an image (called Headstone, below) is as follows:

    %list:getImage(%n, 'HEADSTONE')

  2. Here is a neater and more efficient way of doing this:

    %list:bindImage('HEADSTONE') ... %list:getImage(%n)

    In this last example, the BindImage associates the image with the Stringlist, eliminating the need to specify the image name on the GetImage.

See also