restart at top of code?

Is there command to stop the code and send it to the beginning of the loop or does it have to finish the loop?

I am using a while statement so I can check if button 2 is pushed. I am incrementing a count which after 3000 increments and no button push it moves on. If button two is pushed during the while statement it goes to a function and then returns where it left off. This is the trouble. If it goes to the function I need it to restart at the beginning of the code and not where it left off.

Is this doable? I am just beginning with electronics and coding so I may be missing the command but I havent found it yet.

You can do a "return" from anywhere in the middle of your "loop", and it will effectively go to the beginning of the loop the next time loop() is called...

PERFECT! Thank you. I figured it would be something straight forward that I was missing. Thank you for your help.