want to store data in txt file my code works fine but i dont want to uppend the record in that,so is there any function which will alwyas overwright the txt file and not do the uppend
<br />
if(txtMarket == "EURUSD")<br />
{<br />
m_MainEdit_EUR =m_MainEdit_EUR + Market +"," + Bid +","+ b +","+ Ask +","+ c +","+ High +","+ Low +","+ d +","+ Timestamp+"\n";<br />
myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
LPSTR buf;<br />
int i = m_MainEdit_EUR.GetLength();<br />
buf = m_MainEdit_EUR.GetBuffer(i);<br />
myfile.Write(buf,i);<br />
myfile.Close();<br />
}<br />
<br />
TXT FILE OUTPUT I AM GETTING
<br />
EURUSD,1.2677,D,1.2680,D,1.2696,1.2679,1,01:20<br />
EURUSD,1.2676,D,1.2679,D,1.2696,1.2679,1,01:21<br />
EURUSD,1.2677,U,1.2680,U,1.2696,1.2679,1,01:21<br />
EURUSD,1.2676,D,1.2679,D,1.2696,1.2679,1,01:21<br />
EURUSD,1.2677,U,1.2680,U,1.2696,1.2679,1,01:22<br />
EURUSD,1.2676,D,1.2679,D,1.2696,1.2679,1,01:23<br />
EURUSD,1.2677,U,1.2680,U,1.2696,1.2679,1,01:23<br />
EURUSD,1.2678,U,1.2681,U,1.2696,1.2679,1,01:23<br />
EURUSD,1.2677,D,1.2680,D,1.2696,1.2679,1,01:23<br />
EURUSD,1.2676,D,1.2679,D,1.2696,1.2679,1,01:23<br />
EURUSD,1.2677,U,1.2680,U,1.2696,1.2679,1,01:23<br />
<br />
expecting output<br />
EURUSD,1.2677,U,1.2680,U,1.2696,1.2679,1,01:23<br />
It will always update by last record.
Do you have any suggestion
|