Download MetaTrader 5
To add comments, please log in or register
MQL5.community allows users to store their source codes in MQL5 Storage. Try it!
Dua Yong Rew
5397
Dua Yong Rew 2014.04.10 03:58 

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
30299
Alain Verleyen 2014.04.10 10:09  
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
5397
Dua Yong Rew 2014.04.10 11:13  
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
30299
Alain Verleyen 2014.04.10 13:29  
doshur:

you mean something like this

Yes.
/
To add comments, please log in or register