[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1023

 
eddy:
for(1tf) is just for clarity, not the point

Why, it all compiles ;))
in this variant see above.

 
found...
 
eddy:

I've blanked out the whole start but the error is still there, so it must be somewhere higher

double vtotale[0]; // Вы не сможете изменить размер массива т.к. он стат. сделайте динамич. vtotale[], изменить размер ArrayResize(vtotale,0);
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()  { return(0);} // вернет 0  не забываем про {}
int deinit(){ return(0);}
attach the code file (below " Attach file: " Overview... ) let's not waste time!
 
costy, if you have 1 operator in the body, you can leave out the brackets, can't you?
 
eddy:
costy, if you have 1 operator in the body, you don't have to specify brackets, do you?

Not for functions.

int init()  { return(0);}
int deinit() return(0); //ошибка


int init()  { return(0);}
int deinit(){ return(0);} //все ок

можно и так, если функции выполняются один раз 
void init()  { }
void deinit(){ }
 

should not variables declared in for() be available outside of for()?

  for(int i=obj_total; ;i--)        {            // перебрать объекты
     string name=ObjectName(i);     }            // запомнить имя

  for(int l=size; l>size-new; l--)      {
    string name=ObjectName(vtotale[l]); }   // 'name' - variable already defined
 
eddy:

Aren't variables declared in for() supposed to be available outside of for()?

Wrong, the for(() variables will be available in all execute functions. (say start, but not in inite deinite...).

int p,i; //глобальные переменные в старт ините деините ...
//+------------------------------------------------------------------+
void start(){ 

  for(i=0;i<500;i++){
  }
  for(i=0;i<500;i++){
  }
  for(i=0,p=0;i<500||p<5000;i+=5,p+=30){
  }

}
 
read the HELP :)
 
Aleksander:
read the HELP :)

Sometimes a person needs to have the root explained to them to further their development by help.

I wonder how it was easy for you Aleksander to learn help from 0?

 
I don't remember learning from 0... I didn't have that opportunity... When I started learning MQL in MT3, I had been programming for about 25 years...