ain't it then like this
execute("$$var = $$var + substr("+$arraypart1$arraypart2+"["+$i+"],1,1)")
or have you tried that out?
Generated in 0.055 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.