/
niceSOFT
/
gawk
Обзор
Документация
Войти
/
niceSOFT
/
gawk
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/arrayind3.awk
19 строк
680 B
Andrew J. Schorr
It is OK to use a strnum as a string array subscript, since we now respect the string value.
04 июл 2016, 17:34
04 июл 2016, 17:34
b3fa425
Код
Авторство
О чём код?
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"] }