AddImage (Stringlist function): Difference between revisions
m (→Syntax terms) |
m (Apply Dave's comments) |
||
Line 12: | Line 12: | ||
<td>A <var>Stringlist</var> object.</td></tr> | <td>A <var>Stringlist</var> object.</td></tr> | ||
<tr><th>imageName</th> | <tr><th>imageName</th> | ||
<td>A string that contains the name of an image or of any image item from the required image. This argument is optional if an image has been associated with the <var>Stringlist</var> by a <var>[[BindImage (Stringlist function)|BindImage]]</var> | <td>A string that contains the name of an image or of any image item from the required image. This argument is optional if an image has been associated with the <var>Stringlist</var> by a <var>[[BindImage (Stringlist function)|BindImage]]</var>. Otherwise, it is a required argument.</td></tr> | ||
</table> | </table> | ||
Line 43: | Line 43: | ||
</p> | </p> | ||
A more efficient way of coding the | A more efficient way of coding the <var>For Each Record</var> loop is: | ||
<p class="code">%list:bindImage('CUST') | <p class="code">%list:bindImage('CUST') | ||
Line 54: | Line 54: | ||
</p> | </p> | ||
In this last example, the <var>[[BindImage (Stringlist function)|BindImage]]</var> | In this last example, the <var>[[BindImage (Stringlist function)|BindImage]]</var> associates the image with the <var>Stringlist</var>, eliminating the need to specify the image name on the <var>AddImage</var> invocation. | ||
[[Category:Stringlist methods|Addimage function]] | [[Category:Stringlist methods|Addimage function]] |
Revision as of 23:17, 25 January 2011
Add image as new Stringlist item (Stringlist class)
This callable method copies data from an image to a Stringlist. The AddImage method accepts one argument and returns a numeric result.
Syntax
[%number =] sl:AddImage[( [imageName])]
Syntax terms
%number | A numeric variable to contain the number of items in the indicated Stringlist after the string has been added to the Stringlist. %number is also the item number associated with the added string in the Stringlist. |
---|---|
sl | A Stringlist object. |
imageName | A string that contains the name of an image or of any image item from the required image. This argument is optional if an image has been associated with the Stringlist by a BindImage. Otherwise, it is a required argument. |
Usage notes
All errors result in request cancellation.
Examples
The following example demonstrates how AddImage might be used:
image cust name is string len 20 ssn is string len 10 bdate is string len 8 end image ... find records to %recset name = smith end find ... %list is object stringList %list = new for each record in %recset %cust:name = name %cust:ssn = ssn %cust:bdate = bdate %count = %list:addImage('CUST') end for
A more efficient way of coding the For Each Record loop is:
%list:bindImage('CUST') for each record in %recset %cust:name = name %cust:ssn = ssn %cust:bdate = bdate %count = %list:addImage end for
In this last example, the BindImage associates the image with the Stringlist, eliminating the need to specify the image name on the AddImage invocation.