hi stepan,
both pairs of macros access the same array. Try:
define([MY_HOST_ARRAY], [defn(format([[host_array[%d]]], [$1]))])dnl
define([SET_HOST_ARRAY], [define(format([[host_array[%d]]], [$1]),
[$2])])dnl
define([MY_IP_ARRAY], [defn(format([[ip_array[%d]]], [$1]))])dnl
define([SET_IP_ARRAY], [define(format([[ip_array[%d]]], [$1]),
[$2])])dnl
i had completely misunderstood the 'array' as a TYPE rather than a NAME :-(
with your changes (above), works perfectly. cool!
also, from your prior post:
define([MY_IP_ADDR2],
esyscmd([dig @]MY_DNS_NAME MY_HOST_ARRAY(2)[ | awk 'index($ 0,
"]MY_HOST_ARRAY(2)[") == 1 {printf("%s", $ 5) }']))
works perfectly, now, as well.
next, to figure out multi-dimensional arrays ... but 1st, i need to get some
sleep.
thx! =)
richard
_______________________________________________
M4-discuss mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-discuss