Community discussions

MikroTik App
 
paris9
newbie
Topic Author
Posts: 32
Joined: Mon Feb 03, 2014 9:31 am

Data Type: Array, os 6.7, key => value

Mon Feb 03, 2014 9:52 am

This is the output that I would like to see:

pear=Mikrotik
peach=Abe
apple=12345

However, this is what I am receiving:

0=pear;0=Mikrotik
1=peach;1=Abe
apple=12345

Any ideas why?

The script:

{ :local arr {""}; \
:set arr {\
"apple"=12345 ;\
"pear"=[/system identity get name;] ;\
"peach"="Abe" }; \

:put $arr; \
:put [:typeof $arr]; \
:put [:len $arr]; \

:foreach k,v in=$arr do={ \
:put ("$k=$v") ; \
}; \

:put ($arr->"apple"); \
};
 
paris9
newbie
Topic Author
Posts: 32
Joined: Mon Feb 03, 2014 9:31 am

Re: Data Type: Array, os 6.7, key => value

Mon Feb 03, 2014 9:59 pm