Call a Function from within a Function

Hi All
I am trying to resurrect an old project from years ago (a Hexapod walker). Teaching my grandson about electronics and coding.
The original project was written PIC Basic (Proton IDE) and I am trying to convert to an Arduino UNO.
The part I am having problems with is converting Subroutines to Functions.
I can write and use functions OK but this part of the software calls subroutines from within a subroutine e.g.

'============================================================================== 
' Function Subroutines
'==============================================================================
ForwardStep:   'Go Forwards
    GoSub Rest
    GoSub LeftSideRaise
    GoSub LeftLegsForward
    GoSub RightSideRaise
    GoSub RightLegsForward
    GoSub CentreLegsCentre
    GoSub LegsHome              'Return L & R legs to the Home position
    Return

I have made the following before void Setup();

#include <Arduino.h>

// Put Function declarations here:
	//Go Forwards
	//int ForwardStep (int);
	void ForwardStep();
	
	//Go Backwards
	//int BackwardStep (int);
	void BackwardStep();
	
	//Turn Left
	//int LeftTurn (int);
	void LeftTurn();
	
	//Turn Right
	//int RightTurn (int);
	void RightTurn();
	
	//Move the Robot Forward, Backward, Left or Right
	//int SendToServo (int);
	void SendToServo();
	
	//The Centre Tilt Servo
	//int CentreLegsCentre (int);
	void CentreLegsCentre();
	
	//Move the Right Legs Forwards
	//int RightLegsForward (int);
	void RightLegsForward();
	
	//Move the Right Legs Backwards
	//int RightLegsBackward (int);
	void RightLegsBackward();
	
	//Move the Left Legs Forwards
	//int LeftLegsForward (int);
	void LeftLegsForward();
	
	//Move the Left Legs Backwards
	//int LeftLegsBackward (int);
	void LeftLegsBackward();
	
	//Tilt the Right Hand Side
	//int RightSideRaise (int);
	void RightSideRaise();
	
	//Tilt the Left Hand Side
	//int LeftSideRaise (int);
	void LeftSideRaise();
	
	//Return Left & Right Legs into the Centre Position
	//int LegsHome (int);
	void LegsHome();
	
	//Put ALL of the Legs into the Centre Position
	//int Rest (int);
	void Rest();
	
	//This Routine Holds ALL of the Servomotors in the Centre Position
	//int Hold (int);
	void Hold();

This compiles OK but I’m having problems with the ‘subroutines’

Any help appreciated.
Thanks
Mike

Which problems do you have exactly? You didn’t name them…

Assuming that the functions you have pre-declared are also implemented somewhere in the sketch, you can simply write a new function which calls the other functions:

void ForwardStep() {
    Rest();
    LeftSideRaise();
    LeftLegsForward();
    RightSideRaise();
    RightLegsForward();
    CentreLegsCentre();
    LegsHome();
}

Good idea , but first start self. Your showing is function prototypes in C and in real life one file is complete waste letters. C knows function based on order in file. Prototype is only required if order is oposite or function required in next files, in this situation is prototype placed in header .h file .
And next level of funny is cpp…

Then try

#include <Arduino.h>

void ForwardStep()
{
//do job here
}

...

void setup() 
{

{
	

Thanks guys.
Implemented both suggestions and got the all of the functions set up.
Now I need to go into each one and put in the signals to be sent.
Thanks again.
Mike

Hi Mike, make your life easy! always declare your function prototypes at the top of your file before setup() or put them in a separate prototypes.h file and #include protoypes.h at the top of your main.cpp file. That way you can put your functions where you like in the code.