Why do metatrader crash with loops?

 

Hi, on metatrader, if you code:

while (1>0)

{}

The program does not run and crashes, but why this happen? I see that in other languages there is no problem with this kind of loop. Thanks for answer

 
autotraderbra:

Hi, on metatrader, if you code:

while (1>0)

{}

The program does not run and crashes, but why this happen? I see that in other languages there is no problem with this kind of loop. Thanks for answer

I think that the program does run, but is stuck in a loop.

What is the point of your code?

Put in a break.

 
Keith Watford:

I think that the program does run, but is stuck in a loop.

What is the point of your code?

Put in a break.

I'm just curious, this kind of loop works very well on C, and metatrader is based on C, so i just want to know why it crashes
 
autotraderbra:
I'm just curious, this kind of loop works very well on C, and metatrader is based on C, so i just want to know why it crashes

Because it doesn't check to see if the thread has been stopped. Instead use the following for infinite loops in MQL

while(!IsStopped());