Check your return codes
and find out why.
What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
WHRoeder:
Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
To answer your question @WHRoeder, the return value for the OrderDelete() function is a bool one and the value is false since the file did not succeed in deleting. I printed the value of the OrderDelete() function and it is 0. The same question still goes in a different way: Why is the OrderDelete() function returning false?
Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
macpee:
To answer your question @WHRoeder, the return value for the OrderDelete() function is a bool one and the value is false since the file did not succeed in deleting. I printed the value of the OrderDelete() function and it is 0. The same question still goes in a different way: Why is the OrderDelete() function returning false?
To answer your question @WHRoeder, the return value for the OrderDelete() function is a bool one and the value is false since the file did not succeed in deleting. I printed the value of the OrderDelete() function and it is 0. The same question still goes in a different way: Why is the OrderDelete() function returning false?
There is no OrderDelete() in your code that you show
If you don't want to actually write anything to the file, why don't you use a Global Variable of the Client terminal?
If you want to delete a file , use FileDelete()
macpee: To answer your question @WHRoeder, the return value for the OrderDelete() function is a bool one and the value is false since the file did not succeed in deleting. I printed the value of the OrderDelete() function and it is 0. The same question still goes in a different way: Why is the OrderDelete() function returning false? |
|
WHRoeder:
Sorry everybody. It is FileDelete() I mean to say and not OrderDelete(). I must have written the comment in a hurry. But @WHRoeder, I actually followed your link, but It did not help me in any way. Thanks anyway. Now @GumRai, does a global variable of the terminal retain its last value at restart of the computer? If so, then it is better to use. I shall give it a try now. Thank you for the information.
macpee: To answer your question @WHRoeder, the return value for the OrderDelete() function is a bool one and the value is false since the file did not succeed in deleting. I printed the value of the OrderDelete() function and it is 0. The same question still goes in a different way: Why is the OrderDelete() function returning false? |
|
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 created a file. I want the file to be created when necessary and deleted when necessary, without writing anything to the file. The idea is to use the file as a key to perform an action. If the file exists action A should be take. On the other hand, if the file does not exist action B should be take. Unlike variables, which are always initialized when the Terminal is closed or when your computer is restarted, the file method has no this limitation. It still retains the value of exist or deleted while the computer is restarted or Terminal closed. Now there are times when the file should be created and when the file should be deleted. But the file has not been able to be deleted. See the code I used in trying to delete the fileas follows: