MetaTrader 4 Build 574 with Updated MQL4 Language and Market of Applications Released - page 28

 
mladen:

Just about bugs with parameters now :

Case No.1 : simple string parameters. When attached to the chart it is OK. When terminal is restarted the contents of all string parameters is lost (they are blank). Parameters are not altered in any way in the code (as it is seen from the code)

This is the result after terminal restart :

...

Do you have last build (579) ? It works for me :


 
RaptorUK:
Thats a question I would like the answer to as well . . . I have about 110,000 screen grabs in various subfolders of experts/files that I do not wish to lose . . .

I am sure you have a backup...
 
angevoyageur:
I am sure you have a backup...
Nope . . .
 
RaptorUK:
Nope . . .


 
angevoyageur:

Do you have last build (579) ? It works for me :



Build 579

Still doing the same (the indicator has to be attached to the chart when you restart the terminal - it happens when it is attached to the chart and the terminal is restarted) Here is one simpler example (that displays the value of such a string parameter to the chart - just attach it and restart terminal).

#property indicator_chart_window
#property strict

extern string TestString = "any value"; // Test string value 

//------------------------------------------------------------------
//
//------------------------------------------------------------------
int init()   { return(0); }
int deinit() { return(0); }
int start()  { Comment("Test string value is : ",TestString); return(0); }
 
angevoyageur:


. . . it's current test data on my Laptop, I'll back it up before I reboot my Live Terminal . . . just in case.
 

Hi all, I'm fixing my EA for the coming "big moment" until I'm stuck with importing WinFile.mqh & using it's function to open & write new file. Everything compiles correctly (0 errors & warnings) with build 579 but it just won't open a new file for writing (OpenNewFileForWriting() returns Invalid File handle) when running in demo (build 507 works fine). Here's a simple code I regenerated to troubleshoot the WinFile import. Hope someone knowledgeable could advise. Thanks!

//+------------------------------------------------------------------+
//|                                         TestWinAPI_WriteFile.mq4 |
//|                                     Copyright 2014, BigFisherman |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, BigFisherman"
#include <WinFile.mqh>


int init()
  {
   return(0);
  }
int deinit()
  {
   return(0);
  }

datetime Timer = 0;
int start()
  {
   if (Timer == Time[0]){
      return(0);
   }
   Timer = Time[0];

   string Test_FilePath = "C:\\MT4_Common\\";
   string Test_FileName = "TestWinAPI.txt";
   string Test_File = Test_FilePath + Test_FileName;

   int Test_Handle = OpenNewFileForWriting(Test_File, false);        //FALSE TO PREVENT SHARE READ
   if (!IsValidFileHandle(Test_Handle)){                             //INVALID FILE HANDLE
      Alert("Unable to open " + Test_File + " for writing, terminating. Error#: "+GetLastError());
      return(0);
   }
   else {
      WriteToFile(Test_Handle, "Success write Line1\r\n");
      WriteToFile(Test_Handle, "Success write Line2");
      CloseFile(Test_Handle);
   }
   return(0);
  }
 

Hi,

I am trying to prepare my EA for the new build. I am getting the following 2 compilation errors which I am not sure how to fix. Maybe someone can take a look?

string arrParams [0,2];

Error: '[' invalid index value

#import "wininet.dll"
int HttpSendRequestA(int hRequest,string &lpszHeaders,int dwHeadersLength,string &lpOptional[],int dwOptionalLength);

Error: 'lpOptional' - invalid parameter for import function


 
  1. string arrParams [0,2];
    Where do you see the import requires a 2D array? See https://www.mql5.com/en/forum/149140
  2. int HttpSendRequestA
    The new mt4 uses Unicode. Why are you importing the ANSI flavor
 
mladen:

Build 579

Still doing the same (the indicator has to be attached to the chart when you restart the terminal - it happens when it is attached to the chart and the terminal is restarted) Here is one simpler example (that displays the value of such a string parameter to the chart - just attach it and restart terminal).

Ok, I confirm it's reproducible.