3 ms·
It's also worth mentioning that local variables can be simulated using additional formal parameters. In AWK, any missing parameter in a function call is initial
by augustk 6y ago
It's also worth mentioning that local variables can be simulated using additional formal parameters. In AWK, any missing parameter in a function call is initialized to zero.
Let's say we have a function CharCount which takes a character and a line of text and returns the number of occurrences of that character:
function CharCount(ch, line,
n)
{
...
}
The line break in the parameter list is an AWK convention and indicates that n is a "local variable."
- ratsmack 6y agoI thought the convention was to separate local variables with three spaces like this: function CharCount(ch, line, n)