bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk feature request: array assignment


From: Charles Obler
Subject: gawk feature request: array assignment
Date: Thu, 9 Apr 2009 11:46:29 -0700 (PDT)

Hello awk people -- 

It would be very nice to be able to assign and return arrays.  Currently, when 
I attempt this, I get a fatal "attempt to use array in a scalar context" error 
message.  

I'm attempting to make my awk program somewhat "object-oriented", with 
associative arrays taking the place of "objects" or "classes".  Unfortunately, 
when I try to return or store one of these "objects", awk complains.

E.g.: 

vNaEl = ObjName( vName, vType, vStat)  # create a name object
vNASu++                                # incr array subscripb
vNArr[ vNASu] = vNaEl                  # save the object in the objects array

The third statement kills awk.


      




reply via email to

[Prev in Thread] Current Thread [Next in Thread]