Download MetaTrader 5
To add comments, please log in or register
Download MetaTrader 5 and start trading today!
Selvan
53
Selvan 2015.07.03 08:50 

DEAR SIR

FUNCTION ONE ()

{

BUYSTOP=1;

RETURN BUYSTOP;

}


HOW TO SET THE BUYSTOP VARIABLE FORM OUTSIDE FUNCTION AND HOW TO CHECK THE VALUE OF BUYSTOP VARIABLE OUT SIDE THE FUNCTION

IN SIMPLE I NEED TO GET , SET AND CHECK THE VARIABLE VALUE DEFINED WITH IN THE FUNCTION FROM OUT SIDE THE FUNCTION


PLEASE GIVE ME AN EXAPLE FOR THIS


THANKYOU




Keith Watford
Moderator
7870
Keith Watford 2015.07.03 09:26  

in your main code

int BuyStop;
Function1(BuyStop);

 function

void Function1(int &bs)
  {
  bs=1;
  }

 PS please don't post in capital letters. It is considered rude in forums

Selvan
53
Selvan 2015.07.03 09:54  

please give me an fully solved example

else it is not possible for me to understand

it is my humble request

Keith Watford
Moderator
7870
Keith Watford 2015.07.03 11:11  
SELVAN:

please give me an fully solved example

else it is not possible for me to understand

it is my humble request




Sorry, but i have no idea what you want. Your post is not very clear.

I gave you an example where the variable BuyStop is passed by reference to the function and then the function gives that variable the value 1 

Have you edited your original post? I am sure that it is not the same post that i replied to. 

JD4
1101
JD4 2015.07.03 17:37  
GumRai:

in your main code

 function

 PS please don't post in capital letters. It is considered rude in forums

 

As Gum said, it is bad form.  In text conversation, it is the equivalent of yelling all the time.
JD4
1101
JD4 2015.07.03 17:38  
SELVAN:

please give me an fully solved example

else it is not possible for me to understand

it is my humble request




The best way for you to learn is to have someone point you in the right direction, and have you learn how to do the rest yourself.  For future reference, when posting code, it is suggested that you use the SRC button located at the top of the message entry area, and paste your code pieces within that area.  If you are showing you are trying to work out the problem for yourself, but having issues with it, people seem to be more likely to be willing to help you out when you get stuck, as well.  Basically, if you think it is something worth putting effort into, even if you are not getting it quite right, they will be more encouraged to help you.
/
To add comments, please log in or register