Multi setups and loops how to work please

Hi everyone.
I plan to program combination.ino has:

setup();
loop();

and which included:

subA has { subA_Setup(); subALoop();}; 

subB has { subB_Setup(); subBLoop();};

do I have to put all subA_Setup() and subB_Setup() into setup()? or can just run subA_Setup() only when I call subA, same as subB?
Thanks
Adam

No, you can simply have setup() call subA_Setup() then subB_Setup().

Then, you can have loop() call subALoop() then subBLoop() but...

You have to write subALoop() and subBLoop() in a special way ...

You must write subALoop() and subBLoop() without using "blocking code".

What that means is that each time subALoop() and subBLoop() are called, they execute quickly and next time they are called, they remember where they left off and continue from that point.

Take a look at the "doing several things at once" example to get the idea.

Great!
Thank you.