InvalidSortSpecification class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "<!-- InvalidSortSpecification class --> __NOTOC__ An <var>InvalidSortSpecification</var> exception indicates that the first argument provided to either the <var>[[Sort (Stringlis...")
 
mNo edit summary
Line 6: Line 6:
   
   
This exception class has no properties.
This exception class has no properties.
The class's only method is the <var>[[New_(InvalidSortSpecification_constructor)|New]]</var> constructor, which you would typically use with a <var class="product">User Language</var> <var>[[Throw statement|Throw]]</var> statement to produce an <var>InvalidSortSpecification</var> exception. For example:
The class's only method is the <var>[[#New constructor)|New]]</var> constructor, which you would typically use with a <var class="product">User Language</var> <var>[[Throw statement|Throw]]</var> statement to produce an <var>InvalidSortSpecification</var> exception. For example:
<p class="code"> throw %(invalidSortSpecification):new
<p class="code"> throw %(invalidSortSpecification):new
</p>
</p>
Line 14: Line 14:
   
   
In most cases, a sort specification is part of <var>User Language</var> code, and so should
In most cases, a sort specification is part of <var>User Language</var> code, and so should
always be correct and request cancellation is an appropriate action.  If, however, a sort specification can be entered at least i
always be correct and request cancellation is an appropriate action.  If, however, a sort specification can be entered at least in
n part by an end user, a <var>[[Try statement|Try]]</var>/<var>Catch</var> block might be appropriate, as shown here:
part by an end user, a <var>[[Try statement|Try]]</var>/<var>Catch</var> block might be appropriate, as shown here:
<p class="code"> try %strlist:sort(%sortSpec)
<p class="code"> try %strlist:sort(%sortSpec)
  catch invalidSortSpecification
  catch invalidSortSpecification
Line 26: Line 26:
   
   
   
   
<h2>The InvalidSortSpecification methods</h2>
==The InvalidSortSpecification methods==
{{Template:List of InvalidSortSpecification methods}}
{{Template:List of InvalidSortSpecification methods}}
   
   
Line 37: Line 37:
   
   
   
   
<h2>New constructor</h2>
===New constructor===
{{Template:InvalidSortSpecification:New subtitle}}
{{Template:InvalidSortSpecification:New subtitle}}
   
   
This callable constructor generates an instance of an <var>[[InvalidSortSpecification_class|InvalidSortSpecification]]</var> exception. The <var>New</var> method format follows:
This callable constructor generates an instance of an <var>InvalidSortSpecification</var> exception. The <var>New</var> constructor format follows:
   
   
<h3>Syntax</h3>
<h3>Syntax</h3>

Revision as of 14:30, 8 June 2011


An InvalidSortSpecification exception indicates that the first argument provided to either the Sort or SortNew method (in the Stringlist class) is not a valid sort specification.

This exception class has no properties. The class's only method is the New constructor, which you would typically use with a User Language Throw statement to produce an InvalidSortSpecification exception. For example:

throw %(invalidSortSpecification):new

Remember that catching an exception is done with the Catch statement; if an exception condition occurs outside a Catch for it, the request is cancelled.

In most cases, a sort specification is part of User Language code, and so should always be correct and request cancellation is an appropriate action. If, however, a sort specification can be entered at least in part by an end user, a Try/Catch block might be appropriate, as shown here:

try %strlist:sort(%sortSpec) catch invalidSortSpecification Print 'Invalid ...' ... end try

The InvalidSortSpecification class is available as of version 7.9.


The InvalidSortSpecification methods

The following are the available InvalidSortSpecification class methods.

MethodDescription
NewCreate a new InvalidSortSpecification object

The methods in the class are described in the subsections that follow. In addition:


New constructor

Create a new InvalidSortSpecification object (InvalidSortSpecification class)

[Introduced in Sirius Mods 7.9]

This callable constructor generates an instance of an InvalidSortSpecification exception. The New constructor format follows:

Syntax

%invalidSortSpecification = [%(InvalidSortSpecification):]New

Syntax terms

%itemNotFound A reference to the newly created InvalidSortSpecification object.
%(InvalidSortSpecification)The class name in parentheses denotes a shared method.