New (Stringlist constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%"><b>Create new Stringlist instance</b></span>
{{Template:Stringlist:New subtitle}}


This method returns a new instance of a Stringlist.  
This method returns a new instance of a Stringlist.  
Line 7: Line 7:
New is a member of the [[Stringlist class]].
New is a member of the [[Stringlist class]].


==New Syntax==
==Syntax==
<pre>
{{Template:Stringlist:New syntax}}
%sl = new
===Syntax terms===
%sl = %(Stringlist):new
%sl = %sl:new
</pre>
 
<pre>
%sl = New([imagename])
</pre>
 
===Syntax Terms===
<dl>
<dl>
<dt>%sl
<dt>%sl
Line 25: Line 16:
<dd>A string that contains the name of an image to be "associated" or "bound" to the '''%sl''' Stringlist. This is an optional argument.  ''This argument is case sensitive''. That is, in the likely event the User Language was written in mixed case, with automatic upper-casing in effect, the image name should be in uppercase (see [[Mixed-case User Language]]. </dl>
<dd>A string that contains the name of an image to be "associated" or "bound" to the '''%sl''' Stringlist. This is an optional argument.  ''This argument is case sensitive''. That is, in the likely event the User Language was written in mixed case, with automatic upper-casing in effect, the image name should be in uppercase (see [[Mixed-case User Language]]. </dl>


==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>All errors in New result in request cancellation.
<li>All errors in New result in request cancellation.

Revision as of 19:52, 31 December 2010

Create new Stringlist instance (Stringlist class)


This method returns a new instance of a Stringlist.

New is a constructor and as such can be called with no object, with an explicit class name, or with an object variable, even if that object is null:

New is a member of the Stringlist class.

Syntax

%sl = [%(Stringlist):]New[( [imageName])]

Syntax terms

%sl
A Stringlist object that is set to a new Stringlist object reference.
imagename
A string that contains the name of an image to be "associated" or "bound" to the %sl Stringlist. This is an optional argument. This argument is case sensitive. That is, in the likely event the User Language was written in mixed case, with automatic upper-casing in effect, the image name should be in uppercase (see Mixed-case User Language.

Usage notes

  • All errors in New result in request cancellation.
  • Specifying an image name on the New method is identical to using a simple New with no parameters followed by a BindImage method on the new object:
    %list = new('IMAGENAME')
    

    is equivalent to

    %list = new
    %list:bindImage('IMAGENAME')
    
    For more information about the association or binding of an image to a Stringlist, see Bindiamge (Stringlist function).