Maximum file size for an EA.mq4 ?

 

Hello,


I developed some code into one big file : currently 1544+ lines.

I saved it and compiled : a part of my code was removed at the end, and the 9 last lines are mixed code that could not possibly mean something.

I could not find the max limit for MetaEditor Buffer, supposing that this is due to the MetaEditor buffer size.

Do you know if such limitation exist ?


Regards,

Jean

 
My EA is currently 1477 lines, no problems.
 

Until today I had no problems too (only a few lines added today).

I'm testing removing some parts and try adding some small parts of code until I reach a supposed buffer limitation.

 

I have an EA that is around 85,000 lines (was around 5MB compiled) and it compiles just fine. (this was before I started using include files)

To be sure it matters what you are declaring in your code and how much memory is required by the compiler.

I had some test code that held some 4000 variables and ~95k lines of code and it wouldn't compile unless I trimmed it back to the 85k size I mentioned above..

 

I'm just starting using include files, it will be far clearer and efficient.

Now everything works fine, I can't reproduce what happened before. Now I can compile the 1539 lines I tried to compile before, no errors.

It's really great to know MT4 allow that much, thank you :)


[edit]

In fact it didn't removed a part of the code it took a part of the last lines and added it to the code :

Normal end of the file :

            case 133:
                Print("Trading forbidden. Critical, cannot execute trading functions.");
                ToReturn = false;
                break;
            default:
                Print("Critical error [", FctErrID, "]: ", ErrorDescription(FctErrID), ". cannot execute trading functions.");
                ToReturn = false;
                break;
        }
    }  
        
    return(ToReturn);
}

After save and compile : (happened just once and never since)

            case 132:
                Print("Market is closed. Critical, cannot execute trading functions.");
                ToReturn = false;
                break;
            case 133:
                Print("Trading forbidden. Critical, cannot execute trading functions.");
                ToReturn = false;
                break;
            default:
                Print("Critical error [", FctErrID, "]: ", ErrorDescription(FctErrID), ". cannot execute trading functions.");
                ToReturn = false;
                break;
        }
    }  
        
    return(ToReturn);
}ng functions.");
                ToReturn = false;
                break;
            case 133:
                Print("Trading forbidden. Critical, cannot execute trading functions.");
                ToReturn = false;
                break;
            default:
                Print("Critical error [", FctErrID, "]: ", ErrorDescription(FctErrID), ". cannot execute trading f
[/edit]
 

Ok I found the bug, and it's not a MetaEditor bug: it's caused by the Gmail function "download all" that creates a zip file containing all the files attached to the mail.

I use a Gmail account to periodically save my codes. In this mail there were 2 MQ4 files, I downloaded the two files using this Gmail functionnality, and that's where the bug happened with the code previously quoted above.

Downloading files separately do not produce this bug, which seems to happened only with the Gmail zip function.