InvalidBitNumber class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
<!-- InvalidBitNumber class -->
<!-- InvalidBitNumber class -->
__NOTOC__
__NOTOC__
The <var>InvalidBitNumber</var> exception class indicates that a bit number request by a bit manipulation function was incorrect, either negative, greater than the number of bits in the string, or non-integral.
The <var>InvalidBitNumber</var> exception class indicates that a bit number request by a bit manipulation function was incorrect, either negative, greater than the number of bits in the string, or non-integral. <var>InvalidBitNumber</var> was introduced in Model 204 version 7.5.
   
   
To produce a <var>InvalidBitNumber</var> exception for yourself, you typically use a <var class="product">User Language</var> <var>[[Exceptions#Throwing exceptions|Throw]]</var> statement with an <var>InvalidBitNumber</var> <var>[[New_(InvalidBitNumber_constructor)|New]]</var> constructor.  For example, the following statement throws an <var>InvalidBitNumber</var> exception:
To produce a <var>InvalidBitNumber</var> exception for yourself, you typically use a <var class="product">User Language</var> <var>[[Exceptions#Throwing exceptions|Throw]]</var> statement with an <var>InvalidBitNumber</var> <var>[[New_(InvalidBitNumber_constructor)|New]]</var> constructor.  For example, the following statement throws an <var>InvalidBitNumber</var> exception:

Revision as of 22:14, 29 October 2014


The InvalidBitNumber exception class indicates that a bit number request by a bit manipulation function was incorrect, either negative, greater than the number of bits in the string, or non-integral. InvalidBitNumber was introduced in Model 204 version 7.5.

To produce a InvalidBitNumber exception for yourself, you typically use a User Language Throw statement with an InvalidBitNumber New constructor. For example, the following statement throws an InvalidBitNumber exception:

throw %(invalidBitNumber):new


The InvalidBitNumber methods

The following are the available InvalidBitNumber class methods.

MethodDescription
BitNumberInvalid bit number requested
NewCreate a new InvalidBitNumber object

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

BitNumber property

Invalid bit number requested (InvalidBitNumber class)

[Introduced in Model 204 7.5]

This property returns the invalid bit number that was requested and so caused the exception to be thrown.

Syntax

%number = invalidBitNumber:BitNumber

Syntax terms

%numberThe invalid bit number that was requested and so caused the exception to be thrown
%invalidBitNumber A reference to an instance of a InvalidBitNumber object.

New constructor

Create a new InvalidBitNumber object (InvalidBitNumber class)

[Introduced in Model 204 7.5]

This Constructor generates an instance of an InvalidBitNumber exception. The New method format is as follows:

Syntax

%invalidBitNumber = [%(InvalidBitNumber):]New( bitNumber= number)

Syntax terms

%invalidBitNumber A reference to an instance of a InvalidBitNumber object.
[%(InvalidBitNumber):]The class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a InvalidBitNumber Constructor.
numberThe bit number that will be returned by the BitNumber property.

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:

    %invalidBitNumber = new %invalidBitNumber = %(InvalidBitNumber):new %invalidBitNumber = %invalidBitNumber:new