MSIR.0797 No method linking for implied object: Difference between revisions
(Created page with "A method with an implied object or class was specified, and was followed by another method. This is not allowed.<pre> For example, in the following:<pre> %list is object stringLi...") |
(Automatically generated page update) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
A method with an implied object or class was specified, and was followed by another method. This is not allowed. | A method with an implied object or class was specified, and was followed by another method. This is not allowed. For example: | ||
< | <p class="code">%list is object stringList | ||
... | |||
%list = new</p> | |||
[[Category: | The new method, above, has an implied class (<var>StringList</var>) and is treated the same as if the class was made explicit: | ||
<p class="code">%list is object stringList | |||
... | |||
%list = %(stringList):new</p> | |||
However, when the implied class or object syntax is used, a subsequent method cannot be linked to the previous method. The following, for example, is invalid: | |||
<p class="code">%list is object stringList | |||
... | |||
%list = new:sort('1,10,A')</p> | |||
Values of an enumeration are considered shared members of the class, so they are subject to this restriction, too. | |||
In the odd cases where one might wish to perform another method on the result of a method with an implied class or object, simply split the two methods into two statements: | |||
<p class="code">%list is object stringList | |||
... | |||
%list = new | |||
%list = %list:sort('1,10,A') | |||
</p> | |||
While perhaps slightly inconvenient, this has no negative performance impact. The above example is silly, of course, as there is no point in sorting a new, and so empty, <var>StringList</var>. | |||
{{Template:MSIR.0797 footer}} | |||
[[Category:MSIR.0600 - MSIR.0799]] |
Latest revision as of 23:34, 3 March 2017
A method with an implied object or class was specified, and was followed by another method. This is not allowed. For example:
%list is object stringList ... %list = new
The new method, above, has an implied class (StringList) and is treated the same as if the class was made explicit:
%list is object stringList ... %list = %(stringList):new
However, when the implied class or object syntax is used, a subsequent method cannot be linked to the previous method. The following, for example, is invalid:
%list is object stringList ... %list = new:sort('1,10,A')
Values of an enumeration are considered shared members of the class, so they are subject to this restriction, too.
In the odd cases where one might wish to perform another method on the result of a method with an implied class or object, simply split the two methods into two statements:
%list is object stringList ... %list = new %list = %list:sort('1,10,A')
While perhaps slightly inconvenient, this has no negative performance impact. The above example is silly, of course, as there is no point in sorting a new, and so empty, StringList.
Message attributes:
RETCODEO=0 | Sets online return code |
---|---|
RETCODEB=4 | Sets batch (single user) return code |
CLASS=E | Error class; the message can be suppressed with the X'04' bit setting of the MSGCTL parameter |
AUDITER | Writes the message with line type ER to the audit trail |
COUNT | Increments the error count (ERCNT) parameter |
ECHO | Displays the line that caused the error |