|
From: | OpenMacNews |
Subject: | Re: how 2 manage arrays & stack conflicts in m4? |
Date: | Sun, 07 Aug 2005 01:12:21 -0700 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |