Return multiple values: Difference between revisions

Content added Content deleted
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: Line 351:


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


==={{header|BaCon}}===
==={{header|BaCon}}===