How can I transfer some variable's value from sub-procedure to main program through parameters in TCL?

From: Hans Yin (hansyin_at_hotmail.com)
Date: 10/30/04


Date: 29 Oct 2004 19:25:46 -0700

can I do it like this:

    proc test_proc { variable1 variable2 variable3 } {
            .......
            set or change values of variable1 variable2 variable3
            return
    }
    
    main_proc {
       #get value through test_proc
       test_proc k1 k2 k3
       puts "$k1 $k2 $k3"
    }

I already tried it, but failed. in main_proc those variables(k1,k2,k3)
won't change althrough "variable1 variable2 variable3" were changed in
Proc test_proc. what's wrong?

If it cann't work like this, so how can i do it ?

somebody can help me?

thanks a lot!