“Scripts” are not working in beta9:
[admin@MikroTik] > :foreach i in=[/interface find type=ether] do={ :put [/interface get $i name] }
Script Error: missing required values
invalid item number
Problem seems to be in ‘get’ command.
Routing marks also do not seem to be working, marks are set on packets, but seem to be ignored in routing decision.
Yes it is a bug, foreach sets all value array to i, not just one value from array. Also it happens with disable, enable and remove commands. I hope it will be fixed in next release.
Separator in beta8 was ; too, this is not a problem. Problem is that, for example, find returns array values inside other arrays, while in beta8 only one array is returned.
As for arrays in arrays, I think everything in console is string based, there are no objects and/or objects in objects.
I think I was partialy right, following output is from beta9:
[admin@MikroTik] > :foreach i in=“a,b,c,d” do={ :put $i }
a
b
c
d
That means that foreach enumerates items separated by ‘,’. Since find result is separated via ‘;’, it takes a whole result as one and only item. If in beta8 everything worked fine and find was also separated with ‘;’, than between beta8 and beta9 foreach was changed “back”.
Then I might not be right at all , question than might be where the conversion occurs.
According to what I understood you before, I tried to nest one more foreach enumeration into the code, but that always resulted in crash of the console.
However since we already established that it is a bug in beta9, I’ll leave its wherebouts to the developers.
i believe once you try to change a variables value the console/script crashes. The initial assignment works. I have sent support emails about it to see if they can help.
Also - global variables - please keep them as global across the entire router, not per user.
where’s the try…catch stuff I saw that was added? I can’t seem to find reference to it anymore.