I hope this time I use the code tag properly...
Code:
iFileHandle = FileOpen(fajlnev, fmOpenWrite);
iFileLength = FileSeek(iFileHandle,0,2);
//Megadom, hogy mit kell kiírni
kiirando="Csoport azonosító:," + txtCsoportID->Text + char(13);
kiirando=kiirando + "Előkezelés:," + txtElokezeles->Text + char(13);
kiirando=kiirando + "Előkezelési dózis:," + txtElodozis->Text + char(13);
kiirando=kiirando + "Előkezelés időtartama:," + txtEloido->Text + char(13);
kiirando=kiirando + "Kezelés:," + txtKezeles->Text + char(13);
kiirando=kiirando + "Kezelési dózis:," + txtKezdozis->Text + char(13);
kiirando=kiirando + "Kezelés időtartama:," + txtKezido->Text + char(13) + char(13)+ char(13);
FileSeek(iFileHandle,0,0);
//Kiírom a fileba az adatokat
int tempint=kiirando.Length()+1;
pszBuffer = new char[tempint];
for (int i=1; i< tempint; i++)
{ pszBuffer[i-1]=kiirando[i]; };
FileWrite(iFileHandle, pszBuffer,kiirando.Length());
FileClose(iFileHandle);
}
This is the code. After this I make a small exception handling, nothing serious.
I use char(13) as the enter character here. The weird thing is that the Lister of Total Commander DOES recognize this as an Enter, but the Notepad doesn't.
Thx
Han