M_j:
In MT4: What is the correct way to check if a particular sound file exist.
PlaySound(SoundFileName);
If the SoundFile does not exist it seems I get no error message - it's just skipped.
In MT4: What is the correct way to check if a particular sound file exist.
PlaySound(SoundFileName);
If the SoundFile does not exist it seems I get no error message - it's just skipped.
There isn't any.
You could check GetLastError() Before to clear and then after. don't know if it sets.
You could shell a cmd /c DIR /b «terminalDIR»\sounds\«filename» >«terminalDIR»\files\listing.txt and then read the resulting file to see if it exists.
Or just make the name an external, letting the user specify and responsible.
In case someone is interested:
https://www.mql5.com/en/code/8314
https://www.mql5.com/en/articles/1540
http://www.xpworx.com/mtfr.php
I did not check them yet.
M_j:
The 720 is nice. Since the OP doesn't want to read the file but only determine its existence, the directory functions in Grouped File Operations - https://www.mql5.com/en/articles/1543 Might be better
In case someone is interested:
https://www.mql5.com/en/code/8314
https://www.mql5.com/en/articles/1540
http://www.xpworx.com/mtfr.php
I did not check them yet.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a small question for coders:
In MT4: What is the correct way to check if a particular sound file exist.
PlaySound(SoundFileName);
If the SoundFile does not exist it seems I get no error message - it's just skipped.
Thanks a lot.