Scope/Function names and labels: Difference between revisions

Content deleted Content added
m awk
m wiki syntax and spacing
Line 6: Line 6:
For scope modification facilities see [[Scope modifiers]].
For scope modification facilities see [[Scope modifiers]].


{{lang|AWK}}
{{header|AWK}}


In [awk] function names are always global and can be referenced in sections of code appearing before the definition:
In awk function names are always global and can be referenced in sections of code appearing before the definition:


<lang awk># This program outputs a greeting
<lang awk># This program outputs a greeting
BEGIN {
BEGIN {
sayhello() # Call the function defined below
sayhello() # Call the function defined below
exit
exit
}
}


function sayhello {
function sayhello {