Question: I have a list of Nodes which I loop through:

```
for (int i = 0; i < aNodes.getLength(); i++) {
  //
}

```

For example, assume the list contains 12 items, and that I know 3 items represent a row in a table, and the next 3 belong to the following row. That means my list of 12 Nodes originates from an HTML table containing 4 rows.

After each row I want to do something, for example, create a new object and populate it...or whatever. I have a solution:

```
ArrayList<Account> mAccounts = new ArrayList<Account>();
Account account = new Account();

for (int i = 0; i < aNodes.getLength(); i++) {

            String nodeValue = aNodes.item(i).getNodeValue();
            boolean isNewRow = (i % COLS_PER_ROW == 0);

            if (isNewRow) {
                account = new Account();
                mAccounts.add(account);
            }

            switch (i % COLS_PER_ROW) {
            case ACCOUNT_POS:
                account.setAccount(nodeValue);
                break;
            case BALANCE_POS:
                account.setBalance(nodeValue);
                break;
            case DATE_POS:
                account.setDate(nodeValue);
                break;
            }
        }

```

But there are numerous things I don't like about this solution:

1. An Account instance is created twice first time, once outside the loop and then once because a new row is detected.
2. It uses integer constants ACCOUNT\_POS=0, BALANCE\_POS=1, DATE\_POS=2...this doesn't feel very nice and I think I should be using an enum.
3. I can't use an enum with the loop variable 'i'.
4. I can't use a for each loop since Nodes doesn't implement the correct interface,

Can anyone suggest a better way of doing this that solves the list of things I don't like about it?

Thank you.

Answer: 
There is [Au3Int (Interpreter for AutoIt)](http://code.google.com/p/au3int/) which is very limited in what it can do, but allows you to execute lines of code. The beta version can work with function calls and multi-line statements, but it's buggy and not great.

Unfortunately, AutoIt was not designed with this in mind, so you are going to struggle.
This is the only debugger for AutoIt that even remotely does what you want to: <http://www.autoitscript.com/forum/topic/21834-graphical-autoit-debugger/>