diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-04-12 14:15:35 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-04-12 14:15:35 +0300 |
commit | 74ad8503620cdccd1624fa52cb80f15d777a8b23 (patch) | |
tree | 140e5fbe6e1d0868e3417f3644407e8d19b83af6 /doc/gawk.texi | |
parent | c2e2ed2a5ff176a215f0025598292dbf49b0102a (diff) | |
download | egawk-74ad8503620cdccd1624fa52cb80f15d777a8b23.tar.gz egawk-74ad8503620cdccd1624fa52cb80f15d777a8b23.tar.bz2 egawk-74ad8503620cdccd1624fa52cb80f15d777a8b23.zip |
And more cleanup.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index 22295c6a..fc6faa14 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -13665,7 +13665,7 @@ A contiguous array of four elements might look like the following example, conceptually, if the element values are 8, @code{"foo"}, @code{""}, and 30: -@c @strong{FIXME: NEXT ED:} Use real images here +@c @strong{FIXME: NEXT ED:} Use real images here, and an @float @iftex @c from Karl Berry, much thanks for the help. @tex @@ -17551,8 +17551,9 @@ If @option{--lint} is specified @cindex portability, @code{next} statement in user-defined functions Some @command{awk} implementations generate a runtime -error if you use the @code{next} statement -(@pxref{Next Statement}) +error if you use either the @code{next} statement +or the @code{nextfile} statement +(@pxref{Next Statement}, also @pxref{Nextfile Statement}) inside a user-defined function. @command{gawk} does not have this limitation. @c ENDOFRANGE fudc @@ -20476,6 +20477,16 @@ $ @kbd{gawk -f walk_array.awk} @print{} a[3] = 3 @end example +Walking an array and processing each element is a general-purpose +operation. You might want to consider generalizing the @code{walk_array()} +function by adding an additional parameter named @code{process}. + +Then, inside the loop, instead of simply printing the array element's +index and value, use the indirect function call syntax +(@pxref{Indirect Calls}) on @code{process}, passing it the index +and the value. + + @c ENDOFRANGE libfgdata @c ENDOFRANGE flibgdata @c ENDOFRANGE gdatar |