Build 600 has this bug

 

Dear Brothers I founded a bug

I was using this code to export the data file to c:\Data before updated to build 600

#import "shell32.dll"
int ShellExecuteA(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+

int start()
{
//----
  
   string file_src_path = TerminalPath()+"\experts\files\*.csv";
   string file_dst_path = "C:\Data";
   string file_path = "/c move /y "+"\""+file_src_path+"\""+" "+"\""+file_dst_path+"\"";
   string cysymbol = Symbol();
   int cytfs[] = {PERIOD_D1,PERIOD_W1};
   int num_tfs = ArraySize(cytfs);
   int cur_tf,j;
   for (j=0; j<num_tfs; j++)
   {
      cur_tf = cytfs[j];
      exportfle (cysymbol,cur_tf);
   }
   ShellExecuteA(0, "Open","cmd.exe", file_path , "", 0);
   return(0);

it was working fine. I updated to build 600 and changed the code like as alexvd told

string file_src_path = TerminalInfoString(TERMINAL_DATA_PATH)+"\MQL4\Files\*.csv"";

the file stored well in the Terminal Data Folder

C:\Users\User_account_name\AppData\Roaming\MetaQuotes\Terminal\Instance_id\MQL4\Files

But it's not moving the files to path C:\Data

Because of the windows file handler ShellExecuteA is not executed

Kindly Fix the Problem


With Thanks and Regards

Saravana
 
d.saravana21:

Because of the windows file handler ShellExecuteA is not executed



ShellExecuteW?
 
stringo:

ShellExecuteW?
(This is a good example where neither the old EX4 nor the old MQ4 is backward-compatible. The old EX4 is not backward-compatible because there is a - reasonable - expectation that FileOpen() will use experts\files. The old MQ4 is not backward-compatible because TerminalPath() has to be changed, and DLL calls have to be changed from A to W.)
 
@Stringo Thank you so much bro.. it's working well..
 
gchrmt4:
(This is a good example where neither the old EX4 nor the old MQ4 is backward-compatible. The old EX4 is not backward-compatible because there is a - reasonable - expectation that FileOpen() will use experts\files. The old MQ4 is not backward-compatible because TerminalPath() has to be changed, and DLL calls have to be changed from A to W.)

Old EX4 (not touched by new compiler) still work.

If you want recompile old sources then see list of changes before

 
stringo:

Old EX4 (not touched by new compiler) still work.

If you want recompile old sources then see list of changes before

No, in this example it does not work.

The above script creates a CSV file and then tries to move it from experts\files to C:\Data. The script does not work because the CSV file is no longer in experts\files. The old EX4 has to be replaced, and the old MQ4 also has to be changed.

Moving FileOpen() from experts\files for existing EX4 files breaks backward-compatibility for any EX4 files - like this one - which expect FileOpen() to use experts\files.

 

@Gchrmt4 is right.. the old one will work only with starting the terminal "/portable" switch

 
d.saravana21:

@Gchrmt4 is right.. the old one will work only with starting the terminal with "/portable" switch

(It shouldn't even work them. With /portable, MT4 uses MQL4\files, not experts\files.)
 
stringo:

Old EX4 (not touched by new compiler) still work.

FYI, I first raised this issue with the Service Desk 6 weeks ago but, like you, they have repeatedly given the wrong answer and ignored the problem.
 
gchrmt4:
FYI, I first raised this issue with the Service Desk 6 weeks ago but, like you, they have repeatedly given the wrong answer and ignored the problem.

I remember.

Behavior will not changed. No more chance to store data in the Program Files folder. Better now than too late, when /portable key will have no sence...

 
stringo:

I remember.

Behavior will not changed. No more chance to store data in the Program Files folder. Better now than too late, when /portable key will have no sence...

Yes, it's too late to change it now. But thank you for finally admitting that backward compatibility is broken for some EX4 files.