Call an object method: Difference between revisions
Content added Content deleted
No edit summary |
imported>Acediast (→{{header|COBOL}}: added params) |
||
Line 238: | Line 238: | ||
(. 1 (equals 2)) ; alternative style</syntaxhighlight> |
(. 1 (equals 2)) ; alternative style</syntaxhighlight> |
||
=={{header|COBOL}}== |
=={{header|COBOL}}== |
||
COBOL has two ways to invoke a method: the <code>INVOKE</code> statement and inline method invocation. |
COBOL added object methods in 2002. It has two ways to invoke a method: the <code>INVOKE</code> statement and inline method invocation. |
||
<syntaxhighlight lang="cobol">*> INVOKE |
<syntaxhighlight lang="cobol"> *> INVOKE statements. |
||
INVOKE |
INVOKE my-class "some-method" *> Factory object |
||
USING BY REFERENCE some-parameter |
|||
⚫ | |||
RETURNING foo |
|||
⚫ | |||
⚫ | |||
USING BY REFERENCE some-parameter |
|||
⚫ | |||
RETURNING foo |
|||
⚫ | |||
⚫ | |||
⚫ | |||
MOVE my-class::"some-method"(some-parameter) TO foo |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
MOVE my-instance::"another-method"(some-parameter) TO foo |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|CoffeeScript}}== |
=={{header|CoffeeScript}}== |