Return multiple values: Difference between revisions

→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.
m (ANSI Standard BASIC moved to the BASIC section.)
(→‎{{header|ANSI Standard BASIC}}: Changed to {{header|ANSI BASIC}}; {{works with|Decimal BASIC}}; output.)
Line 351:
 
=={{header|BASIC}}==
==={{header|ANSI Standard BASIC}}===
{{works with|Decimal BASIC}}
The most straightforward way of returning multiple values is to specify them as parameters.
<syntaxhighlight lang="ansi standard basic">100 DECLARE EXTERNAL SUB sumdiff
110 !
120 CALL sumdiff(5, 3, sum, diff)
Line 364 ⟶ 365:
190 LET d = a - b
200 END SUB</syntaxhighlight>
{{out}}
<pre>
Sum is 8
Difference is 2
</pre>
 
==={{header|BaCon}}===
511

edits