Get data line by line from a string

 

Hello,

Please help me for get line by line symboles name  form this string array.

i want get symbol name from "ListSymbols" and put in a variabel and after proccess  get next name .

Thank you 

 {
//---
   int HowManySymbols=SymbolsTotal(true);
   string ListSymbols=" ";
   for(int i=0;i<HowManySymbols;i++)
     {
      ListSymbols=StringConcatenate(ListSymbols,SymbolName(i,true),"\n");
     }
   Comment(ListSymbols);
  
  }
 
Seyed Alireza Hojjatoleslami: i want get symbol name from "ListSymbols" and put in a variabel and after proccess  get next name .

Create an array of symbols instead of one big string.

 
William Roeder #:

Create an array of symbols instead of one big string.

Oh! its a  problem. i dont know mt4 coding . i just do  copy some codes.

can you write a sampel for me please?

 

MT4: Learn to code it.
MT5: Begin learning to code it.

If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2019)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)

 
William Roeder #:

MT4: Learn to code it.
MT5: Begin learning to code it.

If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2019)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)

i don't need a long story for a small function. just show me a sample. I'm a developer but i know how can i find a short way to code. i don't need to a learn C++ for a small EA

Thank you 

 
Seyed Alireza Hojjatoleslami #:

i don't need a long story for a small function. just show me a sample. I'm a developer but i know how can i find a short way to code. i don't need to a learn C++ for a small EA

Thank you 

Then search how to create an array? No point writing what you can't troubleshoot if there is an error.

Your initial approach of storing everything to a single string, you need a delimiter, that is something to know you are at the end of the current Symbol name
 
Thank-god Avwerosuoghene Odukudu #:
Then search how to create an array? No point writing what you can't troubleshoot if there is error.

Your initial approach of storing everything to a single string, you need a delimiter, that is something to know you are at the end of the current Symbol name

It would have been better to write the code instead of giving advice.

I take this problem easily and without knowing c++

Now I'm telling you to know the difference between a coder and a beginner.

smy1=StringConcatenate(smy1,SymbolName(ii,true),"\n");

ii=ii+1;

I just took the code out of the loop and used the data each time and re-executed the code. It may not sound good, but it was enough for me.

Thank you for your help!!

 
Seyed Alireza Hojjatoleslami #: It would have been better to write the code instead of giving advice.

Wrong! We are here on this forum to offer advice, not to code it for you. If you are looking for those to code it for you, you will find them at the Freelance hangout.