Community discussions

MikroTik App
 
user7780
just joined
Topic Author
Posts: 5
Joined: Wed Sep 04, 2024 4:29 pm

correct syntax to get variable

Sat Dec 21, 2024 9:17 pm

hi, dear Experts!
Sorry, my be it stupid question, but I not expert in scripting.
What the syntax should be in the script -
I'm doing it for the main table - everything is fine

:local i 0;
:for i from=0 to=$routeSize step=1 do={
:set ipAddress [/ip route get $i dst-address]

I'm trying to specify another routing table 4G - it doesn't work according to the syntax

:set ipAddress [/ip route get [find where routing-table=4G] $i dst-address]

RouteOS 7.15.3

What wrong I do?
 
user7780
just joined
Topic Author
Posts: 5
Joined: Wed Sep 04, 2024 4:29 pm

Re: correct syntax to get variable

Tue Dec 24, 2024 8:20 am

found solution

must be

:foreach i in=[find where routing-table=4G] do={
:local ipAddress [get $i dst-address]

Who is online

Users browsing this forum: abdolali and 3 guests