What causes stack overflow error in mql4? - page 3

 
RaptorUK:
But it can handle that large a function . . . as I explained, change the function type and there is no compilation error for the same size of function . .


So does it mean an int function requires more resources to execute? Maybe then metaquotes can make init, deinit and start to be void so they consume smaller resources.
 
RaptorUK:
But it can handle that large a function . . . as I explained, change the function type and there is no compilation error for the same size of function . .

. . . or leave it as an int and leave in the return(0); and do this for all the calls . . .

   ReturnedValue = ObCreate("EURUSDg",Column1xg,15,ZoomTimes);
   ReturnedValue = ObCreate("EURUSDa",Column1xa,15,ZoomTimes);

. . . where ReturnedValue is an int . . . guess what ? no compilation error.


Make you code make sense . . . and hey presto, as if by magic the error goes away, weird eh ?

 
An int function returning 0 should be comparable to a void function so this means there is something.
 
tonny:

So does it mean an int function requires more resources to execute? Maybe then metaquotes can make init, deinit and start to be void so they consume smaller resources.
Of course an int function needs more resources to execute . . . it hss to return a value and that value has to be stored in memory to be able to be returned. I have seen people code with init, start and deinit declared as void . . . it's not something I do.
 
RaptorUK:

. . . or leave it as an int and leave in the return(0); and do this for all the calls . . .

. . . where ReturnedValue is an int . . . guess what ? no compilation error.


Make you code make sense . . . and hey presto, as if by magic the error goes away, weird eh ?


The int function is also returning 0. Anyway problem solved but as for the error I think its appearing where it shouldn't.
 
tonny:
An int function returning 0 should be comparable to a void function so this means there is something.
No it isn't . . . a void function does not return a value . . . 0, 1, 10000 values all take the same memory space to save . . . they are all type int and an int uses 4 bytes. void returns nothing, that takes 0 bytes . . .
 
This means even with void if we were to add more objects it would reach stress point and cause the error again. There we agree?
 
Ill take the silence as yes. Case closed.
 
tonny:
This means even with void if we were to add more objects it would reach stress point and cause the error again. There we agree?
No, I don't agree.

But it seems you may be right . . .
 
RaptorUK:
No, I don't agree.

But it seems you may be right . . .

Now we are on the same page.
Reason: