V4.0 beta RC1 - script bug find - dynamic dns related

I found other script problems..

  1. Strange global variables behavior

Global variables are correctly set during script execution … But after script execution :env print will report some variable with correct value and some variable [:nothing]
Every execution, same result,
(i’m usind DDNS script to test it)

http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_ChangeIP.com

  1. different result of route “get” sentence
> :put [/ip route get 0] 
.id=*30000001;dst-address=0.0.0.0/0;gateway=213.205.52.18;gateway-status=213.205
.52.18 reachable pppoe-out1;distance=1;scope=30;target-scope=10;active=true;dyna
mic=true;static=true;disabled=false

no “direct” interface field

As a software developer I could imagine an interface name array visit and substring search…
But off course… Mikrotik script language and environment was not born for this kind of task

  1. Trying to implement this “bad style” substring search …
    I found this doesn’t work too
[admin@Scinty433] > :put [/ip route get 0 gateway-status] 
213.205.XX.XX reachable pppoe-out1
[admin@Scinty433] > :put [:find [/ip route get 0 gateway-status] "pppoe-out1"] 

[admin@Scinty433] > :put [:find [/ip route get 0 gateway-status] pppoe-out1]   

[admin@Scinty433] > :put [:find [/ip route get 0 gateway-status] 213]           

[admin@Scinty433] >

ip route get 0 would work if you have issued the ip route print command first so that ROS knows what 0 is. or at least in previoous versions this was the case.

Inside the full script there is not:

ip route get 0

it was only a quick way to test something else from terminal.

strange variable behavior is dued by:

http://forum.mikrotik.com/t/v4-0-rc1-script-bug-variable-scope-lifetime-foreach/31720/1