MismatchedQuote class: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 16: | Line 16: | ||
</nowiki></p> | </nowiki></p> | ||
To produce a <var>MismatchedQuote</var> exception yourself, you typically use a <var class="product"> | To produce a <var>MismatchedQuote</var> exception yourself, you typically use a <var class="product">SOUL</var> <var>[[Exceptions#Using the Throw statement|Throw]]</var> statement with a <var>MismatchedQuote</var> <var>[[New_(MismatchedQuote_constructor)|New]]</var> 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 a <var>MismatchedQuote</var> exception: | ||
<p class="code">throw %(mismatchedQuote):new | <p class="code">throw %(mismatchedQuote):new | ||
</p> | </p> | ||
Line 23: | Line 23: | ||
<var>Catch</var> for it, the request is cancelled. | <var>Catch</var> for it, the request is cancelled. | ||
The <var>MismatchedQuote</var> class is available as of <var class="product">[[ | The <var>MismatchedQuote</var> class is available as of <var class="product">[[Sirius Mods]]</var> version 7.7. | ||
==The MismatchedQuote methods== | ==The MismatchedQuote methods== | ||
Line 30: | 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 | <li>[[Notation conventions for methods]] has information about the conventions followed. </li> | ||
about the conventions followed. | <li>[[MismatchedQuote methods syntax]] is a single page that contains the syntax diagrams of all the methods in the class. </li> | ||
<li>[[MismatchedQuote methods syntax | |||
</ul> | </ul> | ||
Line 39: | Line 38: | ||
This <var>Constructor</var> generates an instance of an <var>[[MismatchedQuote_class|MismatchedQuote]]</var> exception. The <var>New</var> method format follows: | This <var>Constructor</var> generates an instance of an <var>[[MismatchedQuote_class|MismatchedQuote]]</var> exception. The <var>New</var> method format follows: | ||
===Syntax=== | ===Syntax=== | ||
{{Template:MismatchedQuote:New syntax}} | {{Template:MismatchedQuote:New syntax}} | ||
Line 47: | Line 47: | ||
<td>A reference to an instance of an <var>MismatchedQuote</var> object. </td></tr> | <td>A reference to an instance of an <var>MismatchedQuote</var> object. </td></tr> | ||
<tr><th><var>[%(MismatchedQuote):]</var></th> | <tr><th><var>[%(MismatchedQuote):]</var></th> | ||
<td>The class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes| | <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>MismatchedQuote</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| | <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">%mismatchExc = new | ||
%mismatchExc = %(MismatchedQuote):new | %mismatchExc = %(MismatchedQuote):new | ||
Line 59: | Line 59: | ||
</p> | </p> | ||
</ul> | </ul> | ||
[[Category:System exception classes]] | [[Category:System exception classes]] |
Latest revision as of 21:35, 18 November 2014
A MismatchedQuote exception indicates that an unmatched quote character was found while scanning for a token with the StringTokenizer class. For example:
%t is object stringTokenizer %t = 'foo"bar':stringTokenizer %t:quotes = '"' printText {~=%t:nextToken} printText {~=%t:nextToken}
The result of the above fragment is:
%t:nextToken=foo %t:nextToken= *** 1 CANCELLING REQUEST: MSIR.0750: Class StringTokenizer, function NextToken: MismatchedQuote exception: String contains a mismatched quote ...
To produce a MismatchedQuote exception yourself, you typically use a SOUL Throw statement with a MismatchedQuote 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 a MismatchedQuote exception:
throw %(mismatchedQuote):new
Remember that you catch an exception with the Catch statement; if an exception condition occurs outside a Catch for it, the request is cancelled.
The MismatchedQuote class is available as of Sirius Mods version 7.7.
The MismatchedQuote methods
The following are the available MismatchedQuote class methods.
Method | Description |
---|---|
New | Create a new MismatchedQuote object |
The methods in the class are described in the subsections that follow. In addition:
- Notation conventions for methods has information about the conventions followed.
- MismatchedQuote methods syntax is a single page that contains the syntax diagrams of all the methods in the class.
New constructor
Create a new MismatchedQuote object (MismatchedQuote class)
[Introduced in Sirius Mods 7.7]
This Constructor generates an instance of an MismatchedQuote exception. The New method format follows:
Syntax
%mismatchedQuote = [%(MismatchedQuote):]New
Syntax terms
%mismatchedQuote | A reference to an instance of an MismatchedQuote object. |
---|---|
[%(MismatchedQuote):] | The class name in parentheses denotes a Constructor. See Usage notes, below, for more information about invoking an MismatchedQuote 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:
%mismatchExc = new %mismatchExc = %(MismatchedQuote):new %mismatchExc = %mismatchExc:new