OutOfBounds class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- OutOfBounds class -->
__NOTOC__
__NOTOC__
An <var>OutOfBounds</var> exception indicates
An <var>OutOfBounds</var> exception indicates
Line 24: Line 23:
</nowiki></p>
</nowiki></p>
   
   
The <var>OutOfBounds</var> class is available as of <var class="product">[[Category:System exception classes]]</var> version 7.9.
The <var>OutOfBounds</var> class is available as of <var class="product">[[Sirius Mods]]</var> version 7.9.
   
   
==The OutOfBounds methods==
==The OutOfBounds methods==
Line 31: Line 30:
The methods in the class are described in the subsections that follow. In addition:
The methods in the class are described in the subsections that follow. In addition:
<ul>
<ul>
<li>[[Notation conventions for methods|"Notation conventions for methods"]] has information
<li>[[Notation conventions for methods]] has information about the conventions followed. </li>
about the conventions followed.
<li>[[OutOfBounds methods syntax]] is a single page that contains the syntax diagrams of all the methods in the class. </li>
<li>[[OutOfBounds methods syntax|"OutOfBounds methods syntax"]] is a single page that contains the syntax diagrams of all the methods in the class.
</ul>
</ul>
   
   
Line 40: Line 38:
   
   
This <var>Constructor</var> generates an instance of an <var>[[OutOfBounds_class|OutOfBounds]]</var> exception. The <var>New</var> method format follows:
This <var>Constructor</var> generates an instance of an <var>[[OutOfBounds_class|OutOfBounds]]</var> exception. The <var>New</var> method format follows:
===Syntax===
===Syntax===
{{Template:OutOfBounds:New syntax}}
{{Template:OutOfBounds:New syntax}}
Line 48: Line 47:
<td>A reference to an instance of an <var>OutOfBounds</var> object. </td></tr>
<td>A reference to an instance of an <var>OutOfBounds</var> object. </td></tr>
<tr><th><var>[%(OutOfBounds):]</var></th>
<tr><th><var>[%(OutOfBounds):]</var></th>
<td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking an <var>OutOfBounds</var> <var>Constructor</var>.</td></tr>
<td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|Usage notes]], below, for more information about invoking an <var>OutOfBounds</var> <var>Constructor</var>.</td></tr>
</table>
</table>
   
   
===Usage notes===
===Usage notes===
<ul>
<ul>
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%outOfBoundsExc = new
<li>As described in [[Object variables#Using New or other Constructors|Using New or other Constructors]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is <var>Null</var>:<p class="code">%outOfBoundsExc = new
   
   
%outOfBoundsExc = %(OutOfBounds):new
%outOfBoundsExc = %(OutOfBounds):new
   
   
%outOfBoundsExc = %outOfBoundsExc:new
%outOfBoundsExc = %outOfBoundsExc:new
</p>
</p></li>
</ul>
</ul>
[[Category:System exception classes]]
[[Category:System exception classes]]

Latest revision as of 21:42, 18 November 2014

An OutOfBounds exception indicates that the stringTokenizer class AtEnd property was true when attempting to scan for a token. For example:

%t is object stringTokenizer %t = 'foobar':stringTokenizer printText {~=%t:nextToken} if %t:notAtEnd then printText {~=%t:nextToken} else print 'Safe coding technique protected against OutOfBounds exception' end if print 'Questionable technique...' printText {~=%t:nextToken}

The output from the above fragment is:

%t:nextToken=foobar Safe coding technique protected against OutOfBounds exception Questionable technique... %t:nextToken= *** 1 CANCELLING REQUEST: MSIR.0751: Class StringTokenizer, function NextToken: OutOfBounds exception: Past end of string ...

The OutOfBounds class is available as of Sirius Mods version 7.9.

The OutOfBounds methods

The following are the available OutOfBounds class methods.

MethodDescription
NewCreate a new OutOfBounds object

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

New constructor

Create a new OutOfBounds object (OutOfBounds class)

[Introduced in Sirius Mods 7.9]

This Constructor generates an instance of an OutOfBounds exception. The New method format follows:

Syntax

%outOfBounds = [%(OutOfBounds):]New

Syntax terms

%outOfBounds A reference to an instance of an OutOfBounds object.
[%(OutOfBounds):] The class name in parentheses denotes a Constructor. See Usage notes, below, for more information about invoking an OutOfBounds Constructor.

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:

    %outOfBoundsExc = new %outOfBoundsExc = %(OutOfBounds):new %outOfBoundsExc = %outOfBoundsExc:new