Problem with local variable in console (v3.6)

Hi

Just want to say i am newbie in scripting so far.

I am writing script to do automated job for me but it doesnt work… so i checked local variables under console, and i think something is wrong.

[admin@primary] > :local variable "Hello World"
[admin@primary] > :environment print 

[admin@primary] >

Shouldnt it print my local variable in enviroment ???

I’ve found that this variable should dissapear in new instance of console

local  - defined by local keyword, local variables are not shared with any other script, other instance of the same script or other console logins. The value of local variable value is lost when script finishes.

but why isnt it showing in same instace ??

any suggestions ???

EDIT:

I checked that in version 2.9.x and results are what i expected in v.3.x

[pawel@gandalf] > :local variable "hello World"
[pawel@gandalf] > :environment print
Local Variables
variable=hello World
[pawel@gandalf] >

is it a bug ???

Ok… i;ve found answer in post http://forum.mikrotik.com/t/cli-local-variables-v3/19809/1


EDIT

BUT:

How to make this Working ???

[admin@primary] > {
{... :local test 1 
{... :if ($test=1) do={:local test 2}
{... :put $test                      
{... }         
1
[admin@primary] >

But modiefied script is showing that variable test on begening and inside if statement are two diffrent variables.

[admin@primary] > {
{... :local test 1 
{... :if ($test=1) do={:local test 2; :put $test}
{... :put $test                                  
{... }                               
2
1
[admin@primary] >

So my question is:

How to get access to parent variable from child script ???

[admin@Louis] > {
{... :local test 1
{... :if ($test=1) do={:set test 2; :put $test}
{... :put $test                                
{... }         
2
2

-Louis

Ouch… stupid mistake..

thanks alot louis

TOPIC CLOSED