If I understand you clearly.. you want the code to be {code} in the forloop.. so you can use it? If thats the case y dont you concat the code to the brackets
for (int i=*, i<*)
{
code="{"+code+"}"
}
Reply with more details so I can help you.
Regards,
Ibrahim Karakira