Download MetaTrader 5

need help with loop

To add comments, please log in or register
Publish your trading signal. Gain access to millions of traders!
796790
91
796790 2015.07.26 09:23 

Can somebody help me with loop

Keith Watford
Moderator
9623
Keith Watford 2015.07.26 09:50  

Show your loop

Explain your problem

Maybe someone can help you 

796790
91
796790 2015.07.26 10:04  
string zynga1 ="newvaluezynga1";
string zynga2 ="newvaluezynga2";
string zynga3 ="newvaluezynga3";
string zynga4 ="newvaluezynga4";
string zynga5 ="newvaluezynga5";
string zynga6 ="newvaluezynga6";
string zynga7 ="newvaluezynga7";
string zynga8 ="newvaluezynga8";
string zynga9 ="newvaluezynga9";
string zynga10 ="newvaluezynga10";
I would like to have a loop for this
Keith Watford
Moderator
9623
Keith Watford 2015.07.26 11:18  

You cannot code a loop to do that, but if you use an array, you can do similar

 string zynga[10];
 for(int x=0;x<10;x++)
    {
    zynga[x]="newvaluezynga"+(string)x;
    } 

 That does zynga[0] to zynga[9]

796790
91
796790 2015.07.26 11:20  
Thanks for explaining i will try this.
796790
91
796790 2015.07.26 11:38  

It is not working for me.

Maybey you can check out the expert file.

What i like is to place loops or array in the program.

really appriecied your help 

Files:
Keith Watford
Moderator
9623
Keith Watford 2015.07.26 11:54  
Sorry, but as I have no idea what you are trying to do, I am not going to search through 37KB of code.
796790
91
796790 2015.07.26 12:00  

If you open the file you can see the reason why i want to use loop or array.

Thanks anyway 

Keith Watford
Moderator
9623
Keith Watford 2015.07.26 12:48  
3056527:

If you open the file you can see the reason why i want to use loop or array.

Thanks anyway 

  

I opened the file and I don't know why you want to use a loop or array.

If it is to reduce the lines of code that is understandable, so maybe that is what you want.

I'm just not prepared to go through 1400 lines of code when you haven't explained what your problem is 

796790
91
796790 2015.07.26 13:16  

To reduce the lines is indeed what i want.

And i am sorry that i wasn't clear about that. 

whroeder1
14519
whroeder1 2015.07.26 17:39  
3056527: To reduce the lines is indeed what i want
learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
12
To add comments, please log in or register