Could a Subroutine become a loop, & after an event return to the main program?

Hi , I am still new to Arduino and would like to create a sketch that uses subroutines; when i select a subroutine using an Android app, I send a char by bluetooth to arduino and in the main program select the subroutine with a switch sentence, but the question is...

when i choose a subroutine from the app, i want to stay in that subroutine receiving other information from de app and only if i choose an other option from the app change to another subroutine,, how could i do that?????
I think its a kind a Subroutine loop using a while sentence in the subroutine void but i really dont know how to do that!!


What have you tried so far?

Look at how multiple things are managed in the demo several things at a time.

It is not necessary to "stay" in a subroutine. You can keep track of what is going on using a variable to record the state of the system - for example whether it is in actionA or actionB or whatever you want to call them.

The advantage of that is that the same code can be used, for example, for receiving information for every action.