Download MetaTrader 5

GlobalVariableDel

To add comments, please log in or register
Dua Yong Rew
5522
Dua Yong Rew  

what is the best coding practice?

Do I need to use GlobalVariableCheck first before I call GlobalVariableDel

Or I just call GlobalVariableDel will do. 

Alain Verleyen
Moderator
33480
Alain Verleyen  
doshur:

what is the best coding practice?

Do I need to use GlobalVariableCheck first before I call GlobalVariableDel

Or I just call GlobalVariableDel will do. 

There is no need to check the existence of a GlobalVariable if you have to delete it. Just delete it and check the returned value to detect an eventual error.

Just my opinion.

Dua Yong Rew
5522
Dua Yong Rew  
angevoyageur:

There is no need to check the existence of a GlobalVariable if you have to delete it. Just delete it and check the returned value to detect an eventual error.

Just my opinion.

you mean something like this

if(!GlobalVariableDel("test"))
{
   Print("Error");
}
Alain Verleyen
Moderator
33480
Alain Verleyen  
doshur:

you mean something like this

Yes.
To add comments, please log in or register