Pre build 600 compiler - page 2

 
LawrenceIpsum #:

So let me just recount my experience briefly for anyone who comes this way in the future.

I will be a little circumspect with the details as it seems from my reading that MetaQuotes may be a little sensitive about this information being shared too explicitly in these forums and I don't want to step on any toes.

Firstly there are a number of places on the internet where old copies of the MT4 compiler may be found - including build 509 which I believe is the last build before things changed significantly in build 600 and beyond.  Seek and you will probably find.

It appears that compiler may be run on legacy .mt4 code either from the command line or by double clicking the metaeditor.exe executable.  The editor will create a folder structure for include files etc that is a little different from the modern standards but you'll work it out.  I put my .mq4 file in the same folder as metaeditor.exe and placed all required includes in the created experts/include folder.  Double clicking the editor/compiler allowed the code to be compiled - I didn't try the command line but I expect it would work.

My code compiled with zero errors (it gets many when compiled with contemporary compilers with #STRICT) and I was able to place it in a contemporary MT4 installation where it appeared to run identically to the existing legacy .ex4 files.  I added some diagnostic Print statements, recompiled, copied and was able to see the diagnostic prints in the Experts log.

I did read in another thread that it was possible to determine the release of the compiler that created an .ex4 by examining bytes 6 and 7 (zero-based) of the ex4 file to determine the compiler version.  In all the legacy .ex4 files I looked at these bytes were 0x00 and 0x00 so this is something that was implemented after build 509.  The same was true of the .ex4 file I created with build 509 of metaeditor.exe.  In all case there was a 2004 copyright notice which was considerably before the date of the compiler itself (around 2013).

I will be able to use this to get a version of the legacy code to output the state of its internal variables which should allow me to ensure that my modernized rewrite will generate identical results for dates (and financial cycles) up to Y2038 and then I can separately ensure that it works correctly for dates beyond that.

Interestingly the .ex4 binary file I created was significantly different from the legacy .ex4 file I was working with so I'm unsure of exactly what build of compiler was used for that but the error free compilation and clean test run make me reasonably sure that my comparison process will be a reasonable way to validate that my modernized code does not have significant regressions.

So it CAN be done with a little persistence.

This helped me jump a few steps in a process similar to yours. Thank you kindly.

Reason: