Le 5991 Septembre 1993, Mark Burgess a envoyé: > Daniel, > > the arrays can indeed be multi-dimensional, the real question is what do you > want to do > with the keys? Get indices applies only to one-dimensional arrays, so what > would you want > to do with another array? > > e.g. getindexlist("Hosts","2") > > to extract a list of the second index?
vars: "Zone[dmz][srv1]" string => "10.2.3.4"; "Zone[dmz][srv2]" string => "10.2.3.5"; "Zone[vpn][srv3]" string => "10.2.6.7"; "Zone[vpn][srv4]" string => "10.2.6.8"; > > Daniel Dehennin wrote: >> Hello, >> >> Continuing my exploration of cf3, I find associative arrays greats, but >> is there any chance to make them multi-dimensional? >> >> Something like: >> >> --8<---------------cut here---------------start------------->8--- >> vars: >> "Hosts[server1][ipaddress]" string => "10.2.3.4"; >> "Hosts[server2][ipaddress]" string => "10.2.3.5"; >> --8<---------------cut here---------------end--------------->8--- >> >> Then doing a getindices("Hosts[server1]"). >> >> Regards. >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Help-cfengine mailing list >> Help-cfengine@cfengine.org >> https://cfengine.org/mailman/listinfo/help-cfengine -- Daniel Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine