IP Address without netmask in a global variable

Dear Colleagues,
I need help on a script. I want to put an IP address without /netmask in a global variable to use later in the same script; the code is:

:global address [/ip address get [find interface="lo"] address]
:global addr [:for i from=( [:len $address] - 1) to=0 do={:if ( [:pick $address $i] = "/") do={:put [:pick $address 0 $i]}}]

If I print the variable result in the enviorment space I have this result:

addr = ;

How can I modify my code to put the result in the variable ? Any idea ?

Thank you.

Why does it need to be global if its in the same script?
:local currentAddress [/ip address get [find interface=“lo”] address]
:set currentAddress [:pick $currentAddress 0 [:find $currentAddress “/” -1]]

OK,
now work, thank you!