Hello All.
I am o.k. with creating a file and writing to it.
handle1 = FileOpen ("details.csv", FILE_CSV, ',') ;
handle2 = FileWrite ( handle1, ticket, lot);
But if I try to write to the same file and add information to it, without deleting what is already there I have a problem
handle3 = FileOpen ("details.csv", FILE_CSV, ',') ; which gets no error,
BUT
handle4 = FileWrite( handle3, ticketx, lotx); WONT WORK
THX, for any help. Good day.
Hello,
First open your file with all the options you want to use:
handle1 = FileOpen("details.csv",FILE_READ|FILE_WRITE|FILE_CSV,",");
Then you can write yourRecord into your file:
FileWrite(handle1,yourRecord);
In your example, if you're describing the sequence of your program, you are opening twice your file. Why? This is not logical to open an already open file. This may cause the problem... or may be I didn't get what you're really doing.
Hello,
First open your file with all the options you want to use:
handle1 = FileOpen("details.csv",FILE_READ|FILE_WRITE|FILE_CSV,",");
Then you can write yourRecord into your file:
FileWrite(handle1,yourRecord);
In your example, if you're describing the sequence of your program, you are opening twice your file. Why? This is not logical to open an already open file. This may cause the problem... or may be I didn't get what you're really doing.
Thank you Jacque,
Now it works:
I had to put all three parameters :: FILE_CSV|FILE_READ|FILE_WRITE, in.
int handle3, handle4, ticketx, lotx ;
ticketx =1234;
lotx =5678;
handle3 = FileOpen ("details2.csv", FILE_CSV|FILE_READ|FILE_WRITE,',') ;
if(handle3<1)
{
Print("Did not open to file_ error is ", GetLastError());
return(false);
}
Print ("handle3 is ", handle3);
FileSeek(handle3,0,SEEK_END);
handle4 = FileWrite( handle3, ticketx, lotx);
if(handle4<1)
{
Print("Did not write to4444file_ error is ", GetLastError());
return(false);
}
FileClose(handle3);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello All.
I am o.k. with creating a file and writing to it.
handle1 = FileOpen ("details.csv", FILE_CSV, ',') ;
handle2 = FileWrite ( handle1, ticket, lot);
But if I try to write to the same file and add information to it, without deleting what is already there I have a problem
handle3 = FileOpen ("details.csv", FILE_CSV, ',') ; which gets no error,
BUT
handle4 = FileWrite( handle3, ticketx, lotx); WONT WORK
THX, for any help. Good day.