interrupting a for loop with button press

lewisp:
would it be possible to give me an example of how this might be structured if i used the loop() function? not sure how i would manage the switches between the different modes?

Have a look at how its done in Several Things at a Time and in Planning and Implementing a Program

...R