I can't find a way to add an element to a global array inside a for loop.
The array content is being replaced by the last element.
Clearly Mikrotik scripting syntax is a pita; honestly, it's a simple array push function.
I really hope that someone can help me find out the reason why this isn't working properly.
The array content is being replaced by the last element.
Code:
:global interfaces;:foreach i in=[/interface bridge port find where pvid=80] do={ :local bport [interface bridge port get number=$i]; :put ("$bport"->"interface"); :set $interfaces ($interfaces $bport);}:put $interfaces;
I really hope that someone can help me find out the reason why this isn't working properly.
Statistics: Posted by obinoob — Sun Dec 31, 2023 7:44 pm