Function definition: Difference between revisions

→‎{{header|COBOL}}: replaced superfluous implementations with standards
(Add LDPL)
imported>Acediast
(→‎{{header|COBOL}}: replaced superfluous implementations with standards)
Line 1,141:
 
=={{header|COBOL}}==
In COBOL, ''multiply'' is a reserved word, so the requirements must be relaxed to allow a different function name. The following uses a program:
{{worksWorks with|GnuCOBOLCOBOL-85}}
The following uses a subprogram:
{{works with|IBM Enterprise COBOL for z/OS}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. myTest.
Line 1,171:
END PROGRAM myMultiply.</syntaxhighlight>
 
{{Works with|COBOL 2002}}
This example uses user-defined functions, which were added in COBOL 2002.
{{works with|GnuCOBOL|2.0}}
{{works with|IBM Enterprise COBOL for z/OS|6.4}}
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. myTest.
Anonymous user