Hello. Looking for a way to give the "dhcphosts" variable the value, as num, with actual dynamic dhcp clients number on the system, so I can do something like: (if dhcphosts != 0, do something).
"dhcphosts" stores the value as an array as follows, any idea on how to achieve this?. I need to go from being an array to a number for the variable.
#Variable assignment
[MikroTik] > :global dhcphosts do={ip dhcp-server lease print detail count-only where dynamic}
#Check variable value and type
[MikroTik] > $dhcphosts
1
[MikroTik] > :put [$dhcphosts ]
1
;1
[MikroTik] > :typeof [$dhcphosts ]
1
[MikroTik] > :put [:typeof [$dhcphosts ]]
1
array
[MikroTik] > :put [:typeof ($dhcphosts )]
array