hello, how can i look throught global variable?

 
hello, if my global variable is call
abc1,abc2,abc3,abc4.....

can i use like "for i=1 to 4" to calculate abc"i" ??


thank you for reply
 
Sheldon Kamhello, if my global variable is call abc1,abc2,abc3,abc4..... can i use like "for i=1 to 4" to calculate abc"i" ?? thank you for reply

Use an array — Documentation on MQL5: Language Basics / Variables

double ABC[5]; // Declare array

void SomeFunction( void )
{
   int SizeOfABC = ArraySize( ABC ); // Get size of array

   for( int i = 0; i < SizeOfABC; i++ )
      ABC[i] = i * 3.1415;
};

Please not that the above was not tested or compiled, and was just typed out on this post as an example.

Documentation on MQL5: Language Basics / Variables
Documentation on MQL5: Language Basics / Variables
  • www.mql5.com
Variables - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5