diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-30 10:11:59 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-01-30 10:11:59 +0200 |
commit | 86cd3e2cb5117c5800997d3bb363b6d5470be3ce (patch) | |
tree | aa8c2af3fe3006e0e40186792e85a161020df66f /doc/gawk.texi | |
parent | 2fc1e9855f7983fb75a7f72d3ec97eec467e4709 (diff) | |
parent | 1bd1b885c7dd16b5e4ab78c040312f6f7d742784 (diff) | |
download | egawk-86cd3e2cb5117c5800997d3bb363b6d5470be3ce.tar.gz egawk-86cd3e2cb5117c5800997d3bb363b6d5470be3ce.tar.bz2 egawk-86cd3e2cb5117c5800997d3bb363b6d5470be3ce.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index f7640b58..68512c2d 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -19369,10 +19369,15 @@ the call. A function cannot have two parameters with the same name, nor may it have a parameter with the same name as the function itself. -In addition, according to the POSIX standard, function parameters + +@quotation CAUTION +According to the POSIX standard, function parameters cannot have the same name as one of the special predefined variables -(@pxref{Built-in Variables}). Not all versions of @command{awk} enforce -this restriction. +(@pxref{Built-in Variables}), nor may a function parameter have the +same name as another function. +Not all versions of @command{awk} enforce +these restrictions. +@end quotation Local variables act like the empty string if referenced where a string value is required, and like zero if referenced where a numeric value @@ -20089,13 +20094,13 @@ using indirect function calls: @c file eg/prog/indirectcall.awk # average --- return the average of the values in fields $first - $last -function average(first, last, sum, i) +function average(first, last, the_sum, i) @{ - sum = 0; + the_sum = 0; for (i = first; i <= last; i++) - sum += $i + the_sum += $i - return sum / (last - first + 1) + return the_sum / (last - first + 1) @} # sum --- return the sum of the values in fields $first - $last |