Or instead of setting 'var(name)' you could make the element name the same as the text to be replaced by its value... 'var(%NAME%)' then use 'string map [array get var] ...' to do the mapping.
global var
foreach data [split [join [lrange $var 0 end]] \n] {
set data [string map [list [lindex $data 0] [join [lrange $arg 1 end]]] $data]
}
for some reason that won't parse .. either ive tryed various ways tryed adding list in the before i split after i split .... and so on ive tryed list $var doesn't seem to be working either for some reason it won't parse.. i know its probably a logic reason but i don't understand why all i got from the manual was that that once u open it u should close it i know i know i haveing bit trouble with technical english langue .. sorry hehe