instantiate objects from an array
Did you noticed you have Instruments declared twice? The second declaration is invalid, and moreover its live cycle is only within the current block.
- Ovo: Did you noticed you have Instruments declared twice? The second declaration is invalid, and moreover its live cycle is only within the current block.
If you had used #property strict, the compiler would have warned you about that. - To create an array of objects the object must have a default constructor. See Structures and Classes - MQL4 Documentation. This you have since you didn't declare any constructors.
- You must do any other initialization in a method.
Hi,
I'm trying to create objects by looping through an array...... here's the code, but when I try to compile, I get the error " '[' - invalid index error "
Can somebody confirm if it can be done, and what I'm doing wrong
Thanks in advance.