input variable considered as constant!

 

Hi guys recently something changed?

i was busy with stuff recently i tried to code but no matter what i use as input variable automatically turn to constant!

what should i do now!

input int yolo=0;
void OnTick()
  {
   yolo=yolo+1;
   Comment("Tick counter:");
  }

input variable turn to constant!

 

define variables like this:

extern int yolo = 0;

it would be changeable

 
Amirfakhredin Ghanbari :

Hi guys recently something changed?

i was busy with stuff recently i tried to code but no matter what i use as input variable automatically turn to constant !

what should i do now!


input variable cannot be modified. This is the law.

 
steve.lee:

define variables like this:

extern int yolo = 0;

it would be changeable

problem is it doesnt show in variable stuff window!

 
Vladimir Karputov:

input variable cannot be modified. This is the law.

hmm yeah unlike old extern seems i have to waste memory and assign it to another variable with input!

why call it input variable while its constant not variable!

https://www.mql5.com/en/docs/basis/variables/inputvariables

Documentation on MQL5: Language Basics / Variables / Input Variables
Documentation on MQL5: Language Basics / Variables / Input Variables
  • www.mql5.com
modifier is indicated before the data type. A variable with the input modifier can't be changed inside mql5-programs, such variables can be accessed for reading only. Values of input variables can be changed only by a user from the program properties window. External variables are always reinitialized immediately before the OnInit() is called...