Download MetaTrader 5

How to get file's modifycation time? - page 2

To add comments, please log in or register
ttechnik
258
ttechnik  
gchrmt4:


See https://docs.mql4.com/basis/types/string

MQL4 uses the same mechanism as many other languages such as C and Javascript where you can put special characters in a string constant by prefacing them with \

For example, "Column1\tColumn2" means "Column1 <tab> Column2". Similarly, "Column1\nColumn2" means "Column1 <new-line> Column2"

Because the \ character has a special meaning, you cannot just use \ in a string constant to mean "backslash". You have to use \\

\\ gets replaced with \ in the same way that \t gets replaced with <tab> and \n gets replaced with <new-line>

Therefore, if you do the following:

...you should see the output "c:\windows\win.ini"


Oh, yes, undestand it.

string filename="c:\windows\win.ini"; is  "c:\windows\win.ini"

string filename="c:\windows\nwin.ini"; is  "c:\windows"

Soo, good work, it will not be until after the BS n or t.

MOHAMMED SAFAR AL-OTAIBI
31
MOHAMMED SAFAR AL-OTAIBI  

Alain Verleyen

Files:
894.png 32 kb
Blahtech Limited
6653
James Cater  

Seeing as someone has dragged up this old thread....

There is now an MQL4 method to get the file modification time

https://docs.mql4.com/files/filegetinteger

FileGetInteger - File Functions - MQL4 Reference
FileGetInteger - File Functions - MQL4 Reference
  • docs.mql4.com
[in]  File property ID. The value can be one of the values of the ENUM_FILE_PROPERTY_INTEGER enumeration. If the second variant of the function is used, you can receive only the values of the following properties: [in]  Points to the file location. If the parameter is false, terminal data folder is viewed. Otherwise it is assumed that the file...
12
To add comments, please log in or register