awka (numeric) array "bug" ....

Anonymous
2010-10-19
2013-04-22

  • Anonymous
    2010-10-19

    Hi

    I have found that if I index an array with numeric indices this is (probably) treated as numbers by awka not as "strings" as it is in gawk… and whats worse a call to asort will produce a fatal "segmentaion fault".. but this is VERY easy to work around just add "" before or after the index when filling the array.. (test=x) without the "" the code will fail..

    for (i=1;i<200;i=i+3){
       x++
       test[""i]=x
       }
       print asort(test)