Did you see the program I uploaded just before your last post? Crossrulz said "State Machine", and the title of my Snippet is "(Very) Simple State Machine". I also posted a reply to KMarcella on this forum with a more conventional model of a State Machine. The idea is that if you have sequential things that are "similar, but different", encapsulate the similarities in a loop, and use a Case Statement to separate the differences. Look at the examples, try them out to see what/how they work, and think how you could put what you want to do into the particular machinery illustrated by these examples.
Bob Schor