Declaring variables
Translation variables are not protected from variables in other xlates.
You must declare all variables before using them and explicitly set the variable values; otherwise, the variable values are not as expected.
In this example, the scope of variable z is in the xlate
tcl interp
, which is in an xlate <br>thread
.
Then, in another xlate file that is located in the same xlate thread, you can get the
variables value. test1.xlt
and test2.xlt
to use
the <br>same
TCL interpreter, so that the variable in
test1.xlt is visible in test2.xlt.
For example, there are two xlate files, test1.xlt and test2.xlt. In test1.xlt,there is a variable z.
In test2.xlt, there is no variable to declare. However, you can echo the z variable. This variable is not protected. You can use the variable z (declared in test1.xlt) in test2.xlt.
If you use variable z in test2.xlt, and the value of z is not the same as the value in test1.xlt, then you must reset it.