I am currently looking to figure the scope of #assign variable. However, scope seems to be confusing please see following example and try to explain. I have some hypothesis which works but if somebody has concrete documentation, it will be very helpful.
<#assign test1 = a.test1/>
<#if some_condition>
<#if a.test1?contains(",")>
<#assign mylist = a.test1?split(",")/>
<#assign test1 = mylist?size-1?int/>
</#if>
<!-- Line is giving me exception, if I convert everything to #global it works -->
<#assign testing>${test1} SAJNF</#assign>
</#if>
Can somebody explain scope in #assign and #global?