GetImage (Stringlist subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
{{Template:Stringlist:GetImage subtitle}}
{{Template:Stringlist:GetImage subtitle}}


This method copies data from a specified Stringlist item to an image.
This method copies data from a specified <var>Stringlist</var> item to an image.


==Syntax==
==Syntax==
Line 8: Line 8:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>sl </th>
<tr><th>sl </th>
<td>A Stringlist object. </td></tr>
<td>A <var>Stringlist</var> object. </td></tr>
<tr><th>itemnum </th>
<tr><th>itemnum </th>
<td>The number of the item in the Stringlist. </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 been associated with the Stringlist with a BindImage method ([[BindImage (Stringlist function)]]. 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.</td></tr>
<td>A string that contains the name of an image. This is an optional argument if an image has been associated with the <var>Stringlist</var> with a BindImage method ([[BindImage (Stringlist function)]]. 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.</td></tr>
</table>
</table>


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


<pre>
<pre>
Line 32: Line 32:
</pre>
</pre>


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


[[Category:Stringlist methods|GetImage subroutine]]
[[Category:Stringlist methods|GetImage subroutine]]

Revision as of 21:33, 18 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 been associated with the Stringlist with a BindImage method (BindImage (Stringlist function). 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.
  • One way to extract a Stringlist item into an image (called Headstone, below) is as follows:
    %list:getImage(%n, 'HEADSTONE')
    

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

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

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