Peter Johnson / Publications
Forum
Possible bug with loop decrementing
There is potentially an issue with decrementing loops whereby the value of an unsigned value can go to -1. It's easy enough to work around though. for ( ulong r = 2 ; r >= 0 ; r--) { PrintFormat ( "r= %d" , r); // Workaround MQL5 bug if (r==- 1 ) break ; // do stuff } Results