You could create a bit Flag. When the Button is pressed, the Flag is toggled. When you get to a reasonable point in Code1 Routine, check your Flag. If it has toggled (is now a 1 for example), use...