What layout do you want to be on to do the looping? Customers? As in you want to loop through all the customers?
GetNthRecord can only read data, I'm sure you are aware of that. If you are on a customer, do you want to loop through all of its products.. and do what exactly? Increase the value of Var to Var + 1 for each product records?
If you are going to loop through all products to upate each product record then there is no point in using GetNthRecord.
The benefit of GetNthRecord is that you can loop through records without physically moving to the record. But you can't modify the records that way.
It looks like you are trying to add a line item number for each fruit in a customer order (Starting at 2 for some reason that is not clear)
If that is the case I would simply script a "GTRR and replace" step to number the line items for that order each time an order is edited. Or, loop through the Portal incrementing the VAR field using Go to Portal Row.