Here are the ways of which I am aware:
Most common:
Assume 2 procs proc1 (the invoking proc) and proc2 (the invoked proc).
Assume arg1 and arg2 are the arguments from proc1 that proc 2 wants.
In proc1 (assume proc 2 does not return anything):
set arg1 “1st arg”
set arg2 “2nd arg”
proc2 $arg1 $arg2
Proc 2 starts:
proc proc2 {my_arg1 my_arg2} {……}
In proc 1 (assume proc 2 does return something):
set arg1 “1st arg”
set arg2 “2nd arg”
set stuff [proc2 $arg1 $arg2]
Less common:
In proc1:
set arg1 “1st arg”
set arg2 “2nd arg”
proc2
In Proc2:
upvar $arg1 my_arg1
upvar $arg2 my_arg2
Also:
In proc1:
global arg1
global arg2
set arg1 “1st arg”
set arg2 “2nd arg”
proc2
In proc2:
global arg1
global arg2
There is also a differnt way if using namespaces/packages but I assume you do not want to go there right now.
All of the above have some rules associated with them.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.