Case menu structure assistance needed

Hello Paul

Please ignore the if statement that is greyed out. Detailed description:

I've coded a main menu and a sub menu and want to test moving from the main menu to the sub menu using the enter and escape buttons. The up and down buttons should also work in both the main menu and the sub menu.

Your correct in saying that the loop function is the problem. When I call my main menu function in void loop, the function goes through all the commands and then loops around, being one menu it's not a problem.

When I choose to go to the sub menu i.e. call the sub menu function then the void loop goes through the sub menu function and reaches the end of the loop and then rolls back to the start running through the main menu function and going through the sub menu function again etc.

So what is happening is that its showing the main menu for a few milli seconds and then the sub menu for a few milli seconds so no usable interface in other words.

Thanks for the tip on returning some variables, I'm a bit rusty with my programming and am just getting back into it, but will look into it.