Script doesn't work ok. Please help me solve problem

Welcome,
my script:
:local ipa;
:local ip;
:foreach ip in=[/ip firewall address-list find] do={
:put [/ppp active find address=[get $ip address]];
}[admin@gw-13-02] /ip firewall> address-list print
Flags: X - disabled, D - dynamic

LIST ADDRESS

0 D nat-188.116.15.57 192.168.100.254[admin@gw-13-02] /ppp active> print
Flags: R - radius

NAME SERVICE CALLER-ID ADDRESS UPTIME ENCODING

0 5555 sstp xxxxxxxxxxxx 192.168.100.254 49m44sThe result of this script is:
/system script> run test01

[admin@Why doesn't this script return IP, only blank line?

If I run this:
:foreach ip in=[/ip firewall address-list find] do={
:put [/ppp active find address=[get $ip address]];
}It returns the error:

interrupted
           invalid value for argument address

Whereas if I save the address as a variable first, then it works.
:foreach ip in=[/ip firewall address-list find] do={
:local add [get $ip address]
:put [/ppp active find address=$add];
}Dunno why…

The IP address as stored in the variable also includes the CIDR notation. Try using a small code section to snip it (and thank Boretto):

:local largo [:len $yourIPvariablenamehere];
:local largo [:put ($largo-3)];
:local nomask [:pick $yourIPvariablenamehere 0 $largo];
## replace "local" below with "global" if your IP variable is meant to be global
:local yourIPvariablenamehere $nomask;

Thank you.