Libraries: MultiTester - page 57

 

Thank you very much for your tips!

I managed to make an entry in the robot, but it was crooked.

I am sorry to address you again, but I cannot understand the situation myself.

I wrote a script with your functions. It finds the first set in the___SETfolder and correctly defines its name 214-10000 HEX-449.set (in it prHEX=true) .

Then the commands are executed:

Print (first_set_filename);

Print ("Load: " + (string)FileLoad(first_set_filename, Words,0)); // Print length ofthe read file FileName FILE_COMMON

Settings = ShortArrayToString(Words, 1); // 1 - Unicode

Print ("\nSettings \n", Settings);

Print (MTTESTER::SetSettings(Settings));

The printed Settingsfile is completely different (it has prWPR=true). I can't understand where it came from. And it also loaded into the robot, i.e. the loading worked!!!, half of the problem solved, but the set is still wrong.

Qwen told me to put the set being recorded into the tester\files .

I did that. But it didn't help. Some other set is recorded in Settings for some reason , not the one found when searching for first_set_filename :

214-10000 HEX-449.set.

It must have been left somewhere in memory from previous runs.

Please help me to understand the reason for this.

Regards, Alexander

 
klycko #:

Print("Load: " + (string)FileLoad(first_set_filename, Words,0)); // Print the length of the read file FileName FILE_COMMON

FileLoad(first_set_filename, Words, FILE_COMMON)
 

Print("Load: " + (string)FileLoad(first_set_filename, Words,FILE_COMMON)); // Print the length of the read file FileName FILE_COMMON


With this change it prints: Load: -1


 

If you change a parameter in this line, then:

When FILE_COMMON Load : -1 Settings are not printed

At 0Load: 3556Settings not correct (different, not clear where from )

 
fxsaber FILE_COMMON)); // Print the length of the read file FileName FILE_COMMON.

If you change the parameter in this line, then:

WhenFILE_COMMON Load : -1 Settings are notprinted

At 0Load: 3556Settingsare not correct (different, not clear where from)

 
klycko #:

Please help me understand the reason for this.

In addition to the above.

         Print("Save: " + (FileSave(source_path, Words, FILE_COMMON) ? (string)ArraySize(Words) : "error"));


You need to learn how to use debug. You would see the reason in a minute.

 
fxsaber #:
You need to learn how to use debug. You'd see the cause in a minute.

Thank you for sending me the corrected line of code.

You are right about recommending me to improve my skills and learn debug. Nevertheless, even without using it, of course not in a minute, but in 2-3 hours, I wrote a debugging script SetLoad using the functions you recommended, and with its help I found that the error occurs after the line :

Print("Load: " + (string)FileLoad(first_set_filename, Words,0)) ;

If you change the last parameter in this line, then:

WhenFILE_COMMON Load: -1 Settings are notprinted

At 0 Load: 3556 Settings are not correct (different, not clear where it came from).

I'm currently investigating the Loadprocess , so I interrupt the script with return immediately after the line :

Print (MTTESTER::SetSettings(Settings));


Now you have sent me the corrected line:

Print("Save: " + (FileSave(source_path, Words, FILE_COMMON) ? (string)ArraySize(Words) : "error")));

I put it in the script and compiled it.

But it refers not to the Loadprocess , but to the Save process and has no effect on the error of loading Settings still there are extraneous settings as a result.

 
klycko #:

there are still extraneous settings as a result.

First and second edit - and I have it working.

 
fxsaber #:

First and second edit - and it works for me.

That's amazing!

I've been using the Nocturne1script for a year now .

where the MTTESTER::SetSettings(Settings) command is executed thousands of times.

But in the new script I can't get Settings to be written to the robot using this command. Here in this line in SetLoad:

Print ("\nDid succeed in uploading to robot from FileLoad: ",MTTESTER::SetSettings(Settings));

Simply Mumu is incomprehensible!!!

I moved the folder with sets to the sandbox.MQL5\Files\___SET

Now the first set is consistently found there and loaded into Settings.

Even in two possible ways via FileLoad and GetKthFileContent.

After loading, the correct content of Settingsis printed .

But this set is not loaded into the robot!

I can't understand why the SetLoad command fails :

MTTESTER::SetSettings(Settings) and MTTESTER::SetSettings2(Settings)

although it returns true, but the robot settings are not changed.

Maybe I don't have the latest version of MTTESTER?

Please help me to get the command to work correctly:

MTTESTER::SetSettings(Settings)

 
klycko #:

Please help me to get the command: MTTESTER::SetSettings(Settings) to work correctly

Doesthis script work?