When using the Remove method to remove any string with a position of 0, the Remove method enters an endless loop the results in an out of memory critical error. The issue stems from the difference in the StringSubstr() function between the MT4 and MT5 platform. On Mt5, StringSubstr("hello World",0,0) returns an empty string, while on MT4 the same function returns a copy of the whole string.
Example script to demonstrate bug:
Here is a quick fix and replacement file for CString on MT4.
Report this to the Service Desk, if you didn't already.
Report this to the Service Desk, if you didn't already.
Done, but since they are no longer supporting MQL4 standard library (many bugs in CIndicators they refuse to address) I figured I share it here as well.
- Can someone please advise where I send a Request for Support to Metaquotes. - MQL4 forum
- Get in touch with developers using Service Desk! - MQL5 forum
- Report it to the service desk. MQL5.community - User Memo - MQL5 Articles
- Report it to the Service Desk, not us users.
This is a user's forum not Metaquotes.
- Can someone please advise where I send a Request for Support to Metaquotes. - MQL4 forum
- Get in touch with developers using Service Desk! - MQL5 forum
- Report it to the service desk. MQL5.community - User Memo - MQL5 Articles
- Report it to the Service Desk, not us users.
It might have saved you some time by reading post #2 before you jumped on your high-horse to issue me a citation from the MQL neighborhood watch. And didn't we already establish that this is a metaquotes dba MQL5 Ltd forum?
updated OP with new file to fix the other methods.
If you look at the time stamps, there is two minutes difference in our posts. You post did not exist when I was replying. |
Done, but since they are no longer supporting MQL4 standard library (many bugs in CIndicators they refuse to address) I figured I share it here as well.
Who said that ?
Thanks for sharing.
Metaquotes service desk.
Hello.
Thank you very much, but, unfortunately, we do not have plans to change something.
Best regards,
Support team

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
UPDATE: Bug also affects Remove(), Replace(), Left(), and Insert(). Updated attached file.
When using the Remove method to remove any substring with a position of 0, the Remove method enters an endless loop the results in an out of memory critical error. The issue stems from the difference in the StringSubstr() function between the MT4 and MT5 platform. On Mt5, StringSubstr("hello World",0,0) returns an empty string, while on MT4 the same function returns a copy of the whole string.
Example script to demonstrate bug:
Here is a quick fix and replacement file for CString on MT4. Update: fixed other methods as well