Download MetaTrader 5
To add comments, please log in or register
Find and download Code Base apps via MetaTrader. It is fast!
Musngi
281
Musngi 2016.10.15 16:53 

How to reset the default value of Global Variable Array inside the function?

I use global array to used it in many function but I want to reset it first before using it because I used the global array in different function.

bool x[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};

void aaa()
{
    x[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};    // reset default value
}

 I got error.

honest_knave
970
honest_knave 2016.10.15 20:27  
Take a look at ArrayFill()
Drazen Penic
2409
Drazen Penic 2016.10.16 09:31  
Also, check ArrayInitialize() and get familiar with all other Array Functions
honest_knave
970
honest_knave 2016.10.16 10:26  
Or (although it is slower) just ArrayResize() to zero then back up to the desired size.
/
To add comments, please log in or register