File: arrayind3.awk

package info (click to toggle)
goawk 1.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 10,560 kB
  • sloc: awk: 3,060; yacc: 198; fortran: 189; python: 131; sh: 58; makefile: 12
file content (19 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
BEGIN {
	# initialize cint arrays
        pos[0] = 0
        posout[0] = 0
        split("00000779770060", f)      # f[1] is a strnum
        pos[f[1]] = 1                   # subscripts must be strings!
        for (x in pos) {
                # if x is a strnum, then the
                # x != 0 test may convert it to an integral NUMBER,
		# and we might lose the unusual string representation
		# if the cint code is not careful to recognize that this is
		# actually a string
                if (x != 0)
                        posout[x] = pos[x]
        }
        # which array element is populated?
        print posout[779770060]
        print posout["00000779770060"]
}