Ahah! Thank you both for clarifying the problem. Makes sense now. This is my modified code now, which works:
void MyFunction(float StartTime, float TimeStep, float Interval)
{
do
{
StartTime = MyLoop(StartTime,TimeStep,Interval);
} while(StartTime<5);
return
}
float...