On Tue, Jul 24, 2012 at 12:53 AM, Roland Mainz <[email protected]> wrote: > On Fri, Jul 20, 2012 at 1:26 PM, Roland Mainz <[email protected]> > wrote: >> - poll(1) supports indexed and indexed sparse arrays of compound >> variables of user-defined types. In theory associative arrays should >> work, too... but somehow this currently fails if the associative array >> is a function-local variable (David... any idea why ?) > > Is it actually legal to scan an array of compound variables and add > compound variable elements at the same time ? > Basically we're doing this... > -- snip -- > nv_putsub(array_np, NULL, ARRAY_SCAN); > array_np_sub = array_np; > i = 0; > do > { > if (!(subname=nv_getsub(array_np_sub))) > break; > > np = nv_open_fmt(shp->var_tree, NV_VARNAME|NV_NOFAIL, > "%s[%s].revents", varname, subname); > > nv_putval(np, "a chicken was here", 0); > > nv_close(np); > i++; > } while(array_np_sub && nv_nextsub(array_np_sub)); > -- snip -- > ... it does work for indexed and indexed sparse arrays... but when > associative arrays are involved the "revents" variable gets created... > but with an empty string as value... ;-(
More data: The problems do not occur if the "revents" variable (e.g. myarray[foo].revents) already exists. It seems creating the myarray[foo].revents variable while scanning the same array (myarray[foo] exists) somehow causes the trouble. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [email protected] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
