Here's a basic portal loop which should get you started on your way:
Go to Object [Object Name: "MyPortal"]
Go to Portal Row [First]
Set Field [MYTABLE::TableNumber; $Counter + 1]
Go to Portal Row [Next; Exit after last]
This script assumes the option to add related records is turned off on the relationship. If this makes sense to you, let us know more about what you want to do instead of how you want to do it. I was little confused so I wanted to post something to get you started. Screen shots are welcome.
BTW, you need to name your portal with the Inspector so the the Go to Object script step can tell the Go to Portal Row script step the correct portal.
I would never do this by looping thru portal rows.
Better to either pull up a found set of these records on a layout based on the portal's table and loop thru those records or pull up a list of the portal records' primary keys and loop thru the list using a relationship to access the correct related record.
This avoids layout based issures that can arise from trying to loop thru portal rows.