Call a function: Difference between revisions

Content added Content deleted
(FutureBasic solution added)
m (→‎{{header|FutureBasic}}: Minor edits to descriptions)
Line 2,476: Line 2,476:
</syntaxhighlight>
</syntaxhighlight>


Fixed arguments
Fixed arguments - args passed by value
<syntaxhighlight lang="futurebasic">
<syntaxhighlight lang="futurebasic">
void local fn MyFunction( arg1 as long, arg2 as long, arg3 as long )
void local fn MyFunction( arg1 as long, arg2 as long, arg3 as long )
Line 2,487: Line 2,487:
</syntaxhighlight>
</syntaxhighlight>


Variable arguments
Variable arguments - args passed by value
<syntaxhighlight lang="futurebasic">
<syntaxhighlight lang="futurebasic">
void local fn MyFunction( count as long, ... )
void local fn MyFunction( count as long, ... )
Line 2,507: Line 2,507:
</syntaxhighlight>
</syntaxhighlight>


Return value
Return value - arg passed by value
<syntaxhighlight lang="futurebasic">
<syntaxhighlight lang="futurebasic">
local fn MultiplyByThree( value as long ) as long
local fn MultiplyByThree( value as long ) as long
Line 2,517: Line 2,517:
</syntaxhighlight>
</syntaxhighlight>


Value by reference
Argument passed by reference
<syntaxhighlight lang="futurebasic">
<syntaxhighlight lang="futurebasic">
void local fn MultiplyByThree( value as ^long )
void local fn MultiplyByThree( value as ^long )