Download MetaTrader 5

Bool access

To add comments, please log in or register
How to launch your trading signal and become a provider
Stephen Njuki
5180
Stephen Njuki 2010.10.19 19:14 
I have a base class that declares a number of variables chief among which are 4 bools

These bools are public

I then have two classes that inherit from this base class.

One of these classes is responsible for setting the value of these booleans which it does with no trouble.

My problem is when the other class tries to access the values of these variables once updated, they are always false.

How should I define them in the base class?
Alexey Da
Moderator
6606
Alexey Da 2010.10.19 20:14  
At first you better attach your source code here.

Which build number do you use?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties - Documentation on MQL5
Stephen Njuki
5180
Stephen Njuki 2010.10.19 20:19  
Hi

My source code is over 1k lines long... ;(

am using build 344
hasayama
611
hasayama 2010.10.19 23:46  
ssn:
Hi

My source code is over 1k lines long... ;(

am using build 344

Are you sure that you trying to access same variables? Every child has its own inner variables:

child_1.My_public_var & child_2.My_public_var are absolutely different variables! 

teymur
3
teymur 2010.10.20 00:22  


hi


i want to know, are you make a forex auto system by order?

best regards,Teymur M.

Alexey Da
Moderator
6606
Alexey Da 2010.10.20 09:37  
ssn:
Hi

My source code is over 1k lines long... ;(

am using build 344
Try to shorten the code and attach it here.
Stephen Njuki
5180
Stephen Njuki 2010.10.20 23:15  
I think I have resolved this.

The method in the subclass responsible for setting these variables was private!

Thanks for all the help any way.
To add comments, please log in or register