New (Stringlist constructor)

From m204wiki
Revision as of 21:52, 22 January 2015 by Dme (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create new Stringlist instance (Stringlist class)

This method returns a new instance of a Stringlist.


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

Syntax terms

%sl A Stringlist object that is set to a new Stringlist object reference.
[%(Stringlist):] The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a Stringlist Constructor.
imageName An, optional, 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 SOUL).

Usage notes

  • As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:

    %sl = new %sl = %(Stringlist):new %sl = %sl:new

  • All errors in New result in request cancellation.


  1. 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:

    %sl = new %sl = %(Stringlist):new %sl = %sl:new

  2. 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')

See also

For more information about the association or binding of an image to a Stringlist, see BindImage.