InvalidRegex class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 17: Line 17:
<li>[[InvalidRegex methods syntax|"InvalidRegex methods syntax"]] is a single page that contains the syntax diagrams of all the methods in the class.
<li>[[InvalidRegex methods syntax|"InvalidRegex methods syntax"]] is a single page that contains the syntax diagrams of all the methods in the class.
</ul>
</ul>
<h2>Code property</h2>
{{Template:InvalidRegex:Code subtitle}}
This <var>[[Classes and Objects#readWrite|ReadOnly]]</var> property is an integer <var class="term">code</var> that provides some details about the nature of the error.  This <var class="term">code</var> is really only useful to someone familiar with the implementation of the regular expression processor, so it is likely to be useful only to [http://sirius-software.com/support.html Sirius Software technical support].
<p>No assumptions should be made that a particular error will always produce the same <var class="term">code</var> from release to release of the <var class="product">[[Sirius Mods|Sirius Mods]]</var>, or even between runs of an Online.</p>
<h4>Syntax</h4>
{{Template:InvalidRegex:Code syntax}}
<h4>Syntax terms</h4>
<table class="syntaxTable">
<tr><th>%number</th>
<td>This integer value is associated with the [[Regex_processing|regular expression]] error.
</td></tr>
<tr><th>invalidRegex</th>
<td>A reference to an instance of an <var>[[InvalidRegex_class|InvalidRegex]]</var> object.
</td></tr></table>
<h2>Description property</h2>
{{Template:InvalidRegex:Description subtitle}}
This <var>[[Classes and Objects#readWrite|ReadOnly]]</var> property is a text explanation of the problem.  As descriptive text tends to do, this text ''might'' change between releases of the <var class="product">[[Sirius Mods|Sirius Mods]]</var>.
<h4>Syntax</h4>
{{Template:InvalidRegex:Description syntax}}
<h4>Syntax terms</h4>
<table class="syntaxTable">
<tr><th>%string</th>
<td>This string value describes the [[Regex_processing|regular expression]] error.
</td></tr>
<tr><th>invalidRegex</th>
<td>A reference to an instance of an <var>[[InvalidRegex_class|InvalidRegex]]</var> object.
</td></tr></table>




<h2>New constructor</h2>
<h2>New constructor</h2>
{{Template:InvalidRegex:New subtitle}}
This constructor generates an instance of an <var>[[InvalidRegex_class|InvalidRegex]]</var> exception.
<p>As shown below, the required arguments of the <var>New</var> method is the <var>[[Code_(InvalidRegex_property)|Code]]</var>, <var>[[Description_(InvalidRegex_property)|Description]]</var>, and <var>[[Position_(InvalidRegex_property)|Position]]</var> properties.  Each argument to <var>New</var> sets the value of the corresponding property of the newly constructed <var>InvalidRegex</var> object.</p>
<h4>Syntax</h4>
{{Template:InvalidRegex:New syntax}}
<h4>Syntax terms</h4>
<table class="syntaxTable">
<tr><th>%invalidRegex</th>
<td>A reference to an instance of an <var>InvalidRegex</var> object.
</td></tr>
<tr><th>%(InvalidRegex)</th><td>The class name in parentheses denotes a shared method.</td></tr>
<tr><th><var>Code</var></th>
<td>This [[Methods#Named parameters|name required]] parameter specifies the numeric value (<var class="term">number</var>) to be assigned to the exception object's <var>[[Code_(InvalidRegex_property)|Code]]</var> property.
</td></tr>
<tr><th><var>Description</var></th>
<td>This name required parameter specifies the string value (<var class="term">string</var>) to be assigned to the object's <var>[[Description_(InvalidRegex_property)|Description]]</var> property.
</td></tr>
<tr><th><var>Position</var></th>
<td>This name required parameter specifies the numeric value (<var class="term">number</var>) to be assigned to the object's <var>[[Position_(InvalidRegex_property)|Position]]</var> property.
</td></tr></table>
<h2>Position property</h2>
{{Template:InvalidRegex:Position subtitle}}
This <var>[[Classes and Objects#readWrite|ReadOnly]]</var> property is the position in the [[Regex_processing|regular expression]] determined to be where the regular expression was invalid. It is possible that the mistake was earlier but was not detected until later.
<h4>Syntax</h4>
{{Template:InvalidRegex:Position syntax}}
<h4>Syntax terms</h4>
<table class="syntaxTable">
<tr><th>%number</th>
<td>This numeric value is the position in the regular expression where the error was detected.
</td></tr>
<tr><th>%invalidRegex</th>
<td>A reference to an instance of an <var>[[InvalidRegex_class|InvalidRegex]]</var> object.
</td></tr></table>


[[Category:System exception classes]]
[[Category:System exception classes]]

Revision as of 15:58, 10 May 2011


The InvalidRegex exception class describes an exception associated with an invalid Regular Expression being passed to a method that takes a regular expression argument.

To produce an InvalidRegex exception yourself, you typically use a User Language Throw statement with an InvalidRegex New constructor. This statement must be issued from within a method, and it can only be caught by the code that calls the method. For example, the following statement throws an InvalidRegex exception with the position set to 13, the code set to 666, and the description indicating Bad luck:

throw %(invalidRegex):new(position=13, code=666, - description='Bad luck')

The InvalidRegex methods

The following are the available InvalidRegex class methods.

MethodDescription
CodeNumeric code indicating cause of the exception
DescriptionBrief description of the exception
NewCreate a new InvalidRegex object
PositionRegex position at or before which the error occurred

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


Code property

Numeric code indicating cause of the exception (InvalidRegex class)

This ReadOnly property is an integer code that provides some details about the nature of the error. This code is really only useful to someone familiar with the implementation of the regular expression processor, so it is likely to be useful only to Sirius Software technical support.

No assumptions should be made that a particular error will always produce the same code from release to release of the Sirius Mods, or even between runs of an Online.

Syntax

%number = invalidRegex:Code

Syntax terms

%number This integer value is associated with the regular expression error.
invalidRegex A reference to an instance of an InvalidRegex object.


Description property

Brief description of the exception (InvalidRegex class) This ReadOnly property is a text explanation of the problem. As descriptive text tends to do, this text might change between releases of the Sirius Mods.

Syntax

%string = invalidRegex:Description

Syntax terms

%string This string value describes the regular expression error.
invalidRegex A reference to an instance of an InvalidRegex object.


New constructor

Create a new InvalidRegex object (InvalidRegex class) This constructor generates an instance of an InvalidRegex exception.

As shown below, the required arguments of the New method is the Code, Description, and Position properties. Each argument to New sets the value of the corresponding property of the newly constructed InvalidRegex object.

Syntax

%invalidRegex = [%(InvalidRegex):]New( Position= number, Code= number, - Description= string)

Syntax terms

%invalidRegex A reference to an instance of an InvalidRegex object.
%(InvalidRegex)The class name in parentheses denotes a shared method.
Code This name required parameter specifies the numeric value (number) to be assigned to the exception object's Code property.
Description This name required parameter specifies the string value (string) to be assigned to the object's Description property.
Position This name required parameter specifies the numeric value (number) to be assigned to the object's Position property.


Position property

Regex position at or before which the error occurred (InvalidRegex class)

This ReadOnly property is the position in the regular expression determined to be where the regular expression was invalid. It is possible that the mistake was earlier but was not detected until later.

Syntax

%number = invalidRegex:Position

Syntax terms

%number This numeric value is the position in the regular expression where the error was detected.
%invalidRegex A reference to an instance of an InvalidRegex object.