To be fair, the snippet the OP posted is the same as the one published by Mikrotik here:
https://help.mikrotik.com/docs/display/ ... haschanged
The snippet diamuxin posted is using commands to pick an element of an array.
This should mean that at a certain release the behaviour of RoS changed, from what I have found the behaviour was:
1) if the interface has a single IP address the method of get worked
2) if the interface has more than one IP address failed with an error ("invalid internal item number")
then it changed to:
3) if the interface has more than one IP address return an empty value as
4) what is returned is an array and so you have to pick the right element
Reference here:
viewtopic.php?t=177121
The get method should still work but only for interfaces with a single IP address, but since it is possible (and actually also common enough) to have more than one IP address on an interface, the "right" method is the "pick" one that should work in all cases.
What I don't understand is why seemingly the "limited" command produced the network mask, it should have been either an error or an empty string.