@LeuGim, Thanks for the offer but i am sorry, I don't want a full solution because i am trying to learn this macro. Now, i think manipulating "i" directly is the easiest option. For that, this is my assumption. Please correct me if i am wrong.
1. In a statmentList, all lines are a valid nim statement. 2. if you loop through a statementList, you will get each valid nim statement line. 3. You can manipulate or edit that statement but you need to use ".repr" for that, 4. After editing you will need to use the parseStmt function to create a valid nim statement from your string statement. 5. After creating a valid nim statement, you can add it to result.
