aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.info')
-rw-r--r--doc/gawk.info570
1 files changed, 303 insertions, 267 deletions
diff --git a/doc/gawk.info b/doc/gawk.info
index cc0c2598..e20d14b6 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -12899,6 +12899,42 @@ that `i' is a local variable, not an argument):
foo's i=1
top's i=10
+ Besides scalar values (strings and numbers), you may also have local
+arrays. By using a parameter name as an array, `awk' treats it as an
+array, and it is local to the function. In addition, recursive calls
+create new arrays. Consider this example:
+
+ function some_func(p1, a)
+ {
+ if (p1++ > 3)
+ return
+
+ a[p1] = p1
+
+ some_func(p1)
+
+ printf("At level %d, index %d %s found in a\n",
+ p1, (p1 - 1), (p1 - 1) in a ? "is" : "is not")
+ printf("At level %d, index %d %s found in a\n",
+ p1, p1, p1 in a ? "is" : "is not")
+ print ""
+ }
+
+ BEGIN {
+ some_func(1)
+ }
+
+ When run, this program produces the following output:
+
+ At level 4, index 3 is not found in a
+ At level 4, index 4 is found in a
+
+ At level 3, index 2 is not found in a
+ At level 3, index 3 is found in a
+
+ At level 2, index 1 is not found in a
+ At level 2, index 2 is found in a
+

File: gawk.info, Node: Pass By Value/Reference, Prev: Variable Scope, Up: Function Caveats
@@ -26798,7 +26834,7 @@ critical, that for any given branch, the above incantation _just works_.
tar -xpzvf PACKAGE-X.Y.Z.tar.gz
cd PACKAGE-X.Y.Z
./configure && make && make check
- make install # as root
+ make install # as root
B. These days the maintainer uses Ubuntu 10.11 which is medium
current, but he is already doing the above for `autoconf' and
@@ -31929,271 +31965,271 @@ Node: Function Example535992
Node: Function Caveats538586
Node: Calling A Function539007
Node: Variable Scope540122
-Node: Pass By Value/Reference542097
-Node: Return Statement545537
-Node: Dynamic Typing548518
-Node: Indirect Calls549253
-Node: Library Functions558938
-Ref: Library Functions-Footnote-1561937
-Node: Library Names562108
-Ref: Library Names-Footnote-1565579
-Ref: Library Names-Footnote-2565799
-Node: General Functions565885
-Node: Strtonum Function566838
-Node: Assert Function569768
-Node: Round Function573094
-Node: Cliff Random Function574637
-Node: Ordinal Functions575653
-Ref: Ordinal Functions-Footnote-1578723
-Ref: Ordinal Functions-Footnote-2578975
-Node: Join Function579184
-Ref: Join Function-Footnote-1580955
-Node: Getlocaltime Function581155
-Node: Data File Management584870
-Node: Filetrans Function585502
-Node: Rewind Function589641
-Node: File Checking591028
-Node: Empty Files592122
-Node: Ignoring Assigns594352
-Node: Getopt Function595905
-Ref: Getopt Function-Footnote-1607209
-Node: Passwd Functions607412
-Ref: Passwd Functions-Footnote-1616387
-Node: Group Functions616475
-Node: Walking Arrays624559
-Node: Sample Programs626128
-Node: Running Examples626805
-Node: Clones627533
-Node: Cut Program628757
-Node: Egrep Program638602
-Ref: Egrep Program-Footnote-1646375
-Node: Id Program646485
-Node: Split Program650101
-Ref: Split Program-Footnote-1653620
-Node: Tee Program653748
-Node: Uniq Program656551
-Node: Wc Program663980
-Ref: Wc Program-Footnote-1668246
-Ref: Wc Program-Footnote-2668446
-Node: Miscellaneous Programs668538
-Node: Dupword Program669726
-Node: Alarm Program671757
-Node: Translate Program676506
-Ref: Translate Program-Footnote-1680893
-Ref: Translate Program-Footnote-2681121
-Node: Labels Program681255
-Ref: Labels Program-Footnote-1684626
-Node: Word Sorting684710
-Node: History Sorting688594
-Node: Extract Program690433
-Ref: Extract Program-Footnote-1697916
-Node: Simple Sed698044
-Node: Igawk Program701106
-Ref: Igawk Program-Footnote-1716263
-Ref: Igawk Program-Footnote-2716464
-Node: Anagram Program716602
-Node: Signature Program719670
-Node: Internationalization720770
-Node: I18N and L10N722202
-Node: Explaining gettext722888
-Ref: Explaining gettext-Footnote-1727954
-Ref: Explaining gettext-Footnote-2728138
-Node: Programmer i18n728303
-Node: Translator i18n732503
-Node: String Extraction733296
-Ref: String Extraction-Footnote-1734257
-Node: Printf Ordering734343
-Ref: Printf Ordering-Footnote-1737127
-Node: I18N Portability737191
-Ref: I18N Portability-Footnote-1739640
-Node: I18N Example739703
-Ref: I18N Example-Footnote-1742338
-Node: Gawk I18N742410
-Node: Advanced Features743027
-Node: Nondecimal Data744531
-Node: Array Sorting746114
-Node: Controlling Array Traversal746811
-Node: Array Sorting Functions755049
-Ref: Array Sorting Functions-Footnote-1758723
-Ref: Array Sorting Functions-Footnote-2758816
-Node: Two-way I/O759010
-Ref: Two-way I/O-Footnote-1764442
-Node: TCP/IP Networking764512
-Node: Profiling767356
-Node: Debugger774810
-Node: Debugging775778
-Node: Debugging Concepts776211
-Node: Debugging Terms778067
-Node: Awk Debugging780664
-Node: Sample Debugging Session781556
-Node: Debugger Invocation782076
-Node: Finding The Bug783405
-Node: List of Debugger Commands789893
-Node: Breakpoint Control791227
-Node: Debugger Execution Control794891
-Node: Viewing And Changing Data798251
-Node: Execution Stack801607
-Node: Debugger Info803074
-Node: Miscellaneous Debugger Commands807055
-Node: Readline Support812500
-Node: Limitations813331
-Node: Arbitrary Precision Arithmetic815583
-Ref: Arbitrary Precision Arithmetic-Footnote-1817225
-Node: General Arithmetic817373
-Node: Floating Point Issues819093
-Node: String Conversion Precision819974
-Ref: String Conversion Precision-Footnote-1821680
-Node: Unexpected Results821789
-Node: POSIX Floating Point Problems823942
-Ref: POSIX Floating Point Problems-Footnote-1827767
-Node: Integer Programming827805
-Node: Floating-point Programming829558
-Ref: Floating-point Programming-Footnote-1835867
-Node: Floating-point Representation836131
-Node: Floating-point Context837296
-Ref: table-ieee-formats838138
-Node: Rounding Mode839522
-Ref: table-rounding-modes840001
-Ref: Rounding Mode-Footnote-1843005
-Node: Gawk and MPFR843186
-Node: Arbitrary Precision Floats844428
-Ref: Arbitrary Precision Floats-Footnote-1846857
-Node: Setting Precision847168
-Node: Setting Rounding Mode849901
-Ref: table-gawk-rounding-modes850305
-Node: Floating-point Constants851485
-Node: Changing Precision852909
-Ref: Changing Precision-Footnote-1854309
-Node: Exact Arithmetic854483
-Node: Arbitrary Precision Integers857591
-Ref: Arbitrary Precision Integers-Footnote-1860591
-Node: Dynamic Extensions860738
-Node: Extension Intro862061
-Node: Plugin License863264
-Node: Extension Design863938
-Node: Old Extension Problems865009
-Ref: Old Extension Problems-Footnote-1866519
-Node: Extension New Mechanism Goals866576
-Ref: Extension New Mechanism Goals-Footnote-1869288
-Node: Extension Other Design Decisions869474
-Node: Extension Mechanism Outline871221
-Ref: load-extension872246
-Ref: load-new-function873724
-Ref: call-new-function874705
-Node: Extension Future Growth876686
-Node: Extension API Description877428
-Node: Extension API Functions Introduction878748
-Node: General Data Types882823
-Ref: General Data Types-Footnote-1888456
-Node: Requesting Values888755
-Ref: table-value-types-returned889486
-Node: Constructor Functions890440
-Node: Registration Functions893436
-Node: Extension Functions894121
-Node: Exit Callback Functions895940
-Node: Extension Version String897183
-Node: Input Parsers897833
-Node: Output Wrappers906414
-Node: Two-way processors910807
-Node: Printing Messages912929
-Ref: Printing Messages-Footnote-1914006
-Node: Updating `ERRNO'914158
-Node: Accessing Parameters914897
-Node: Symbol Table Access916127
-Node: Symbol table by name916639
-Ref: Symbol table by name-Footnote-1918811
-Node: Symbol table by cookie918891
-Ref: Symbol table by cookie-Footnote-1923020
-Node: Cached values923083
-Ref: Cached values-Footnote-1926284
-Node: Array Manipulation926375
-Ref: Array Manipulation-Footnote-1927473
-Node: Array Data Types927512
-Ref: Array Data Types-Footnote-1930234
-Node: Array Functions930326
-Node: Flattening Arrays934092
-Node: Creating Arrays940923
-Node: Extension API Variables945719
-Node: Extension Versioning946355
-Node: Extension API Informational Variables948256
-Node: Extension API Boilerplate949342
-Node: Finding Extensions953176
-Node: Extension Example953723
-Node: Internal File Description954461
-Node: Internal File Ops958149
-Ref: Internal File Ops-Footnote-1969233
-Node: Using Internal File Ops969373
-Ref: Using Internal File Ops-Footnote-1971729
-Node: Extension Samples971995
-Node: Extension Sample File Functions973438
-Node: Extension Sample Fnmatch981807
-Node: Extension Sample Fork983533
-Node: Extension Sample Ord984747
-Node: Extension Sample Readdir985523
-Node: Extension Sample Revout987861
-Node: Extension Sample Rev2way988454
-Node: Extension Sample Read write array989144
-Node: Extension Sample Readfile991027
-Node: Extension Sample API Tests991782
-Node: Extension Sample Time992307
-Node: gawkextlib993616
-Node: Language History995999
-Node: V7/SVR3.1997521
-Node: SVR4999842
-Node: POSIX1001284
-Node: BTL1002292
-Node: POSIX/GNU1003026
-Node: Common Extensions1008561
-Node: Ranges and Locales1009668
-Ref: Ranges and Locales-Footnote-11014286
-Ref: Ranges and Locales-Footnote-21014313
-Ref: Ranges and Locales-Footnote-31014573
-Node: Contributors1014794
-Node: Installation1019090
-Node: Gawk Distribution1019984
-Node: Getting1020468
-Node: Extracting1021294
-Node: Distribution contents1022986
-Node: Unix Installation1028208
-Node: Quick Installation1028825
-Node: Additional Configuration Options1030787
-Node: Configuration Philosophy1032264
-Node: Non-Unix Installation1034606
-Node: PC Installation1035064
-Node: PC Binary Installation1036363
-Node: PC Compiling1038211
-Node: PC Testing1041155
-Node: PC Using1042331
-Node: Cygwin1046516
-Node: MSYS1047516
-Node: VMS Installation1048030
-Node: VMS Compilation1048633
-Ref: VMS Compilation-Footnote-11049640
-Node: VMS Installation Details1049698
-Node: VMS Running1051333
-Node: VMS Old Gawk1052940
-Node: Bugs1053414
-Node: Other Versions1057266
-Node: Notes1062581
-Node: Compatibility Mode1063168
-Node: Additions1063951
-Node: Accessing The Source1064878
-Node: Adding Code1066304
-Node: New Ports1072346
-Node: Derived Files1076481
-Ref: Derived Files-Footnote-11081786
-Ref: Derived Files-Footnote-21081820
-Ref: Derived Files-Footnote-31082420
-Node: Future Extensions1082518
-Node: Basic Concepts1084005
-Node: Basic High Level1084686
-Ref: figure-general-flow1084957
-Ref: figure-process-flow1085556
-Ref: Basic High Level-Footnote-11088785
-Node: Basic Data Typing1088970
-Node: Glossary1092325
-Node: Copying1117636
-Node: GNU Free Documentation License1155193
-Node: Index1180330
+Node: Pass By Value/Reference543085
+Node: Return Statement546525
+Node: Dynamic Typing549506
+Node: Indirect Calls550241
+Node: Library Functions559926
+Ref: Library Functions-Footnote-1562925
+Node: Library Names563096
+Ref: Library Names-Footnote-1566567
+Ref: Library Names-Footnote-2566787
+Node: General Functions566873
+Node: Strtonum Function567826
+Node: Assert Function570756
+Node: Round Function574082
+Node: Cliff Random Function575625
+Node: Ordinal Functions576641
+Ref: Ordinal Functions-Footnote-1579711
+Ref: Ordinal Functions-Footnote-2579963
+Node: Join Function580172
+Ref: Join Function-Footnote-1581943
+Node: Getlocaltime Function582143
+Node: Data File Management585858
+Node: Filetrans Function586490
+Node: Rewind Function590629
+Node: File Checking592016
+Node: Empty Files593110
+Node: Ignoring Assigns595340
+Node: Getopt Function596893
+Ref: Getopt Function-Footnote-1608197
+Node: Passwd Functions608400
+Ref: Passwd Functions-Footnote-1617375
+Node: Group Functions617463
+Node: Walking Arrays625547
+Node: Sample Programs627116
+Node: Running Examples627793
+Node: Clones628521
+Node: Cut Program629745
+Node: Egrep Program639590
+Ref: Egrep Program-Footnote-1647363
+Node: Id Program647473
+Node: Split Program651089
+Ref: Split Program-Footnote-1654608
+Node: Tee Program654736
+Node: Uniq Program657539
+Node: Wc Program664968
+Ref: Wc Program-Footnote-1669234
+Ref: Wc Program-Footnote-2669434
+Node: Miscellaneous Programs669526
+Node: Dupword Program670714
+Node: Alarm Program672745
+Node: Translate Program677494
+Ref: Translate Program-Footnote-1681881
+Ref: Translate Program-Footnote-2682109
+Node: Labels Program682243
+Ref: Labels Program-Footnote-1685614
+Node: Word Sorting685698
+Node: History Sorting689582
+Node: Extract Program691421
+Ref: Extract Program-Footnote-1698904
+Node: Simple Sed699032
+Node: Igawk Program702094
+Ref: Igawk Program-Footnote-1717251
+Ref: Igawk Program-Footnote-2717452
+Node: Anagram Program717590
+Node: Signature Program720658
+Node: Internationalization721758
+Node: I18N and L10N723190
+Node: Explaining gettext723876
+Ref: Explaining gettext-Footnote-1728942
+Ref: Explaining gettext-Footnote-2729126
+Node: Programmer i18n729291
+Node: Translator i18n733491
+Node: String Extraction734284
+Ref: String Extraction-Footnote-1735245
+Node: Printf Ordering735331
+Ref: Printf Ordering-Footnote-1738115
+Node: I18N Portability738179
+Ref: I18N Portability-Footnote-1740628
+Node: I18N Example740691
+Ref: I18N Example-Footnote-1743326
+Node: Gawk I18N743398
+Node: Advanced Features744015
+Node: Nondecimal Data745519
+Node: Array Sorting747102
+Node: Controlling Array Traversal747799
+Node: Array Sorting Functions756037
+Ref: Array Sorting Functions-Footnote-1759711
+Ref: Array Sorting Functions-Footnote-2759804
+Node: Two-way I/O759998
+Ref: Two-way I/O-Footnote-1765430
+Node: TCP/IP Networking765500
+Node: Profiling768344
+Node: Debugger775798
+Node: Debugging776766
+Node: Debugging Concepts777199
+Node: Debugging Terms779055
+Node: Awk Debugging781652
+Node: Sample Debugging Session782544
+Node: Debugger Invocation783064
+Node: Finding The Bug784393
+Node: List of Debugger Commands790881
+Node: Breakpoint Control792215
+Node: Debugger Execution Control795879
+Node: Viewing And Changing Data799239
+Node: Execution Stack802595
+Node: Debugger Info804062
+Node: Miscellaneous Debugger Commands808043
+Node: Readline Support813488
+Node: Limitations814319
+Node: Arbitrary Precision Arithmetic816571
+Ref: Arbitrary Precision Arithmetic-Footnote-1818213
+Node: General Arithmetic818361
+Node: Floating Point Issues820081
+Node: String Conversion Precision820962
+Ref: String Conversion Precision-Footnote-1822668
+Node: Unexpected Results822777
+Node: POSIX Floating Point Problems824930
+Ref: POSIX Floating Point Problems-Footnote-1828755
+Node: Integer Programming828793
+Node: Floating-point Programming830546
+Ref: Floating-point Programming-Footnote-1836855
+Node: Floating-point Representation837119
+Node: Floating-point Context838284
+Ref: table-ieee-formats839126
+Node: Rounding Mode840510
+Ref: table-rounding-modes840989
+Ref: Rounding Mode-Footnote-1843993
+Node: Gawk and MPFR844174
+Node: Arbitrary Precision Floats845416
+Ref: Arbitrary Precision Floats-Footnote-1847845
+Node: Setting Precision848156
+Node: Setting Rounding Mode850889
+Ref: table-gawk-rounding-modes851293
+Node: Floating-point Constants852473
+Node: Changing Precision853897
+Ref: Changing Precision-Footnote-1855297
+Node: Exact Arithmetic855471
+Node: Arbitrary Precision Integers858579
+Ref: Arbitrary Precision Integers-Footnote-1861579
+Node: Dynamic Extensions861726
+Node: Extension Intro863049
+Node: Plugin License864252
+Node: Extension Design864926
+Node: Old Extension Problems865997
+Ref: Old Extension Problems-Footnote-1867507
+Node: Extension New Mechanism Goals867564
+Ref: Extension New Mechanism Goals-Footnote-1870276
+Node: Extension Other Design Decisions870462
+Node: Extension Mechanism Outline872209
+Ref: load-extension873234
+Ref: load-new-function874712
+Ref: call-new-function875693
+Node: Extension Future Growth877674
+Node: Extension API Description878416
+Node: Extension API Functions Introduction879736
+Node: General Data Types883811
+Ref: General Data Types-Footnote-1889444
+Node: Requesting Values889743
+Ref: table-value-types-returned890474
+Node: Constructor Functions891428
+Node: Registration Functions894424
+Node: Extension Functions895109
+Node: Exit Callback Functions896928
+Node: Extension Version String898171
+Node: Input Parsers898821
+Node: Output Wrappers907402
+Node: Two-way processors911795
+Node: Printing Messages913917
+Ref: Printing Messages-Footnote-1914994
+Node: Updating `ERRNO'915146
+Node: Accessing Parameters915885
+Node: Symbol Table Access917115
+Node: Symbol table by name917627
+Ref: Symbol table by name-Footnote-1919799
+Node: Symbol table by cookie919879
+Ref: Symbol table by cookie-Footnote-1924008
+Node: Cached values924071
+Ref: Cached values-Footnote-1927272
+Node: Array Manipulation927363
+Ref: Array Manipulation-Footnote-1928461
+Node: Array Data Types928500
+Ref: Array Data Types-Footnote-1931222
+Node: Array Functions931314
+Node: Flattening Arrays935080
+Node: Creating Arrays941911
+Node: Extension API Variables946707
+Node: Extension Versioning947343
+Node: Extension API Informational Variables949244
+Node: Extension API Boilerplate950330
+Node: Finding Extensions954164
+Node: Extension Example954711
+Node: Internal File Description955449
+Node: Internal File Ops959137
+Ref: Internal File Ops-Footnote-1970221
+Node: Using Internal File Ops970361
+Ref: Using Internal File Ops-Footnote-1972717
+Node: Extension Samples972983
+Node: Extension Sample File Functions974426
+Node: Extension Sample Fnmatch982795
+Node: Extension Sample Fork984521
+Node: Extension Sample Ord985735
+Node: Extension Sample Readdir986511
+Node: Extension Sample Revout988849
+Node: Extension Sample Rev2way989442
+Node: Extension Sample Read write array990132
+Node: Extension Sample Readfile992015
+Node: Extension Sample API Tests992770
+Node: Extension Sample Time993295
+Node: gawkextlib994604
+Node: Language History996987
+Node: V7/SVR3.1998509
+Node: SVR41000830
+Node: POSIX1002272
+Node: BTL1003280
+Node: POSIX/GNU1004014
+Node: Common Extensions1009549
+Node: Ranges and Locales1010656
+Ref: Ranges and Locales-Footnote-11015274
+Ref: Ranges and Locales-Footnote-21015301
+Ref: Ranges and Locales-Footnote-31015561
+Node: Contributors1015782
+Node: Installation1020078
+Node: Gawk Distribution1020972
+Node: Getting1021456
+Node: Extracting1022282
+Node: Distribution contents1023974
+Node: Unix Installation1029196
+Node: Quick Installation1029813
+Node: Additional Configuration Options1031775
+Node: Configuration Philosophy1033252
+Node: Non-Unix Installation1035594
+Node: PC Installation1036052
+Node: PC Binary Installation1037351
+Node: PC Compiling1039199
+Node: PC Testing1042143
+Node: PC Using1043319
+Node: Cygwin1047504
+Node: MSYS1048504
+Node: VMS Installation1049018
+Node: VMS Compilation1049621
+Ref: VMS Compilation-Footnote-11050628
+Node: VMS Installation Details1050686
+Node: VMS Running1052321
+Node: VMS Old Gawk1053928
+Node: Bugs1054402
+Node: Other Versions1058254
+Node: Notes1063569
+Node: Compatibility Mode1064156
+Node: Additions1064939
+Node: Accessing The Source1065866
+Node: Adding Code1067292
+Node: New Ports1073334
+Node: Derived Files1077469
+Ref: Derived Files-Footnote-11082777
+Ref: Derived Files-Footnote-21082811
+Ref: Derived Files-Footnote-31083411
+Node: Future Extensions1083509
+Node: Basic Concepts1084996
+Node: Basic High Level1085677
+Ref: figure-general-flow1085948
+Ref: figure-process-flow1086547
+Ref: Basic High Level-Footnote-11089776
+Node: Basic Data Typing1089961
+Node: Glossary1093316
+Node: Copying1118627
+Node: GNU Free Documentation License1156184
+Node: Index1181321

End Tag Table