Can't get File Write or Print Ouput from Script

 

I wrote a script to manipulate a set of matrices and want to check the dimension of the result matrix. I wrote output to a file (csv) and also print it. I can't find neither of them. I use explorer to find the csv file. No joy. Any help is appreciate.


File write is line 158 and print is 161.

Files:
 

Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893


If the file output was successful, then you will find the files in the folder "<Data Folder>\MQL5\Files".


 

Also, I don't see any code in your Script to close the file, or to at least flush the output to disk. If you don't, it might just remain cached in memory with nothing on disk.

 

Upon further analysis, you also don't use the file handle when writing to the file.

Your code ...

FileWrite("sigma row ",      sigma.Rows(),     " sigma col ",    sigma.Cols() , 
          " VT row ",        VT.Rows(),        " VT col ",       VT.Cols(), 
          " Temp row ",      temp.Rows(),      " temp col ",     temp.Cols() );

Missing the handle parameter ... Documentation on MQL5: File Functions / FileWrite

uint  FileWrite(
   int  file_handle,   // File handle
   ...                 // List of recorded parameters
   );
EDIT: You also don't check the file handle to see if it is valid and the file was successfully created or if it failed.
Documentation on MQL5: File Functions / FileWrite
Documentation on MQL5: File Functions / FileWrite
  • www.mql5.com
The function is intended for writing of data into a CSV file, delimiter being inserted automatically unless it is equal to 0. After writing into...