Function definition: Difference between revisions

Content added Content deleted
imported>Acediast
(→‎{{header|COBOL}}: I don't actually have access to IBM Enterprise COBOL for z/OS version 6.4 so I'm just going off the docs)
(Add LDPL)
Line 2,128: Line 2,128:
multiply call (2, 3).
multiply call (2, 3).
multiply call: 2, 3.</syntaxhighlight>
multiply call: 2, 3.</syntaxhighlight>

=={{header|LDPL}}==
<syntaxhighlight lang="ldpl">data:
n is number

procedure:
sub multiply
parameters:
x is number
y is number
result is number
procedure:
in result solve x * y
end sub

# call the bare sub-procedure
call multiply with 3 4 n
display n lf

# create a statement for it
create statement "multiply $ by $ in $" executing multiply

multiply 3 by 4 in n
display n lf
</syntaxhighlight>
{{out}}
<pre>
12
12
</pre>


=={{header|LFE}}==
=={{header|LFE}}==