How to list into comment GlobalVariables

 

Hello,


Please help to list some global variables into Comment();


I can Print, but I need to display names into Comment, the way it is coded only displays the first GlobalVar that it finds.

 void Get_GV_Name() 
 { 
      for(int i=GlobalVariablesTotal()-1;i>=0;i--)
      {
      string name=GlobalVariableName(i);
      // if(StringFind(name,"Pattern")>-1)Print("GlobalVarName = ",GlobalVariableName(i));
      if(StringFind(name,"Pattern")>-1)Comment(GlobalVariableName(i));
      }  
     } 

cheers

 
Baptiste George:

Hello,


Please help to list some global variables into Comment();


I can Print, but I need to display names into Comment, the way it is coded only displays the first GlobalVar that it finds.

cheers

   string comment = "";
 
   for(int i=GlobalVariablesTotal()-1; i>=0; i--)
   {
      string name = GlobalVariableName(i);
      if(StringFind(name,"Pattern",0) >= 0)
         comment += "\n" + name;
   }  
   Comment(comment);
 
Paul Anscombe:

Working in awesome way!


Thank you.

Reason: