Forum OpenACS Q&A: Response to Defining ad_procs within a script?

Collapse
Posted by David Walker on
If you're just looking to reuse a piece of code in a bunch of different places you could also use a tcl string for that as shown below

set code_to_reuse {
 ns_write $var1
 ns_write $var2
}

set var1 xxx
set var2 yyy
eval $code_to_reuse
set var1 123
set var2 456
eval $code_to_reuse