How to retrieve values calculated in templates after template execution done?
First of all, be sure your application is designed well: templates should display data, and almost never calculate data. If you are still sure you want to do it, read on… When you use <#assign x = "foo">, then you do not actually modify the data-model (since that is read-only, see: Programmer’s Guide/Miscellaneous/Multithreading), but create the x variable in the runtime environment of the processing (see Programmer’s Guide/Miscellaneous/Variables).