Cycle while and condition false for loop

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
Moderator
3423
GumRai 2016.09.23 09:58 #
 
bool A= false;

while
(A==false) 
{ // Do something that may/will change the value of A to true }   

also you need an escape in case nothing will change it to true.

avatar
86
fly7680 2016.09.24 06:55 #
 

I made this change to change the status of A fale to true:

int A  = false;
int N1 = 1+i;

A=  Close[N1] < Sell;          
         
           
      //Indicator Buffer 1 Sell     
        if (a1)
        
        while
        ( A==false )
        { N1--;}

 // Again I can not exit the loop, then I added this option but the editor gives me error that expression has no effect:

     { N1--; N1 <= 10;} //expression has no effect
avatar
Moderator
3423
GumRai 2016.09.24 07:17 #
 
        while
        ( A==false )
        { N1--;}

I'm sorry to be blunt, but it seems that it is impossible to help you.

We can't keep repeating the same thing over and over, you are just wasting the time of people that are trying to help you.

avatar
1225
FMIC 2016.09.24 12:45 #
 
fly7680:

I made this change to change the status of A fale to true:

Before you can code in MQL4, you should first learn how to code in general. A "while" loop is one of those basic things that you should learn how to use properly.

Here is a link on Wikipedia on the subject with a graphical flow diagram that might help you understand. It also shows how the "while" loop is used in many, many languages. Have a look at the one for C & C++ as that is the form used by MQL4 too.

Also, here are a few links for sites that offer tutorials and learning for "C" that will also help:

avatar
86
fly7680 2016.09.24 13:21 #
 
Thanks again for your patience and all the advice that you gave me, I will study carefully from these links you posted me.
Back to topics list   | 1 2  

To add comments, please log in or register