int handle = FileOpen("file.csv", FILE_CSV | FILE_WRITE, ';'); if(handle > 0) { double d = 1.5555; FileWrite(handle, d); int error=GetLastError(); MessageBox("OK = " + ErrorDescription(error)); FileClose(handle); }
awesome thanks that works... so i guess FileWriteDouble doesn't work
FileWriteDouble is meant for use with binary files, you specified CVS type of a file, for which you use FileWrite.
one more question - How do I read csv files? There's no FileRead(), and FileReadDouble gives the same 'incompatible access...' error
thanks
nm, i can do it through FileReadString, and StrToDouble
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
Hi,
When I run the following code I get the output "OK = incompatible access to a file, bytes = -1". Can anyone see why? The file is being created ok, it just won't write any values (or read, if i put the values in manually).
Thanks