common function returning

hi all, hopefully I can explain this properly with generic terms:
I have lets say, 3 states created in my program, States A; B; C;

state B is needed to be used in both State A & C.
Is there a proper way that I can go from State A & C while jumping back and forth to/from B ?
in State A, go to B (check on a result),
go back into A (with status from B),
then go to C, while in C, go to B (check on a result),
go back into C, (with status from B),

hopefully that makes sense.
I have tried using the Return statement in “B” hoping it would know where it was called from and know where to return to, but it won’t even get out of “B” state, unless i explicitly tell it where to return to.

I suspect that what you need is a function, not another state. Call it GeneratorIsRunning or some such and have it return a boolean.

shoot, i was so focused on states i didn’t understand nor realize the distinction and functionality of such.’
Thanks wildbill (again, again, and again)…

just changed it to jump over to void RUNCHECK () function, and its stuck in that function loop and doesn't go back to the void HandleRunningState() function it was in.
Any suggestions on what I'm missing ?

i figured out what I was doing wrong. All seems to be working correctly now.