return function

 

hi all


does the return function go up just one level or all the way to the very top root (ontick)

for ex if you have 5 nested loops/ifs, if the 5th one hits a return, will it go back to the ontick or just to the 4th level loop?

tnks

 
zelda_lee:

hi all


does the return function go up just one level or all the way to the very top root (ontick)

for ex if you have 5 nested loops/ifs, if the 5th one hits a return, will it go back to the ontick or just to the 4th level loop?

tnks

It will return control to the where the function was called from, nothing to do with loops or ifs

 

Also, return is an operator, not a function.

Read https://www.mql5.com/en/docs/basis

 
i see, ok thanks guys for the reply!