Thank you for posting more information and the example code. I understand quite well now. I have attached my answer as a state machine. This will be the best thing for what you want to do (multiple sections of code in a predetermined order, but unknown number of times).
Randy Hoskin Applications Engineer National Instruments http://www.ni.com/ask
Randy, sorry, your solution is really good, but it doesn't work in my case, because some of my loop - actions include dialogs with the user. And while one of this dialog-including loops is waiting for the answer of the user all the other loops still have to be executed.
If you add a separate 'actions' loop to the state machine example then you can execute actions which dont halt the main execution loops. You do need to use a few local variables though.
I've included 2 examples. The first has one action loop, and only allows one action to be taken at a time. The second has 3 action loops which allows all 3 actions to occur at the same time (although the one button dialog does not show 3 popups as it is not reentrant).