Anonymous user
Call a function: Difference between revisions
→{{header|AWK}}
Line 121:
The awk extraction and reporting language does not support the use of named parameters.
=={{header|Batch File}}==
Batch files do not have a traditional "function" system like OOP languages, however this is the closest thing to it. The only difference between a block of code and a function is the way method you choose to invoke it. It's also worth noting that all batch files can be called from any other batch file, performing a function. A function should be put somewhere in the code where it will not be parsed unless the script is redirected there.
<lang dos>
@echo off
::call a function with no arguments
call :myFunction
::call a function with arguments
call :myFunction arg1 "arg 2"
::initiate a "function".
:myFunction
echo arg1 - %1
echo arg2 - %~2
goto :eof
</lang>
=={{header|C}}==
|