Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.Button1Click(Sender: TObject);
- var
- BackUpFile : TextFile;
- i: Integer;
- cLine : string;
- begin
- AssignFile(BackUpFile, 'c:\BackUp.txt');
- Rewrite(BackUpFile);
- DBGrid1.DataSource.DataSet.First;
- while not DBGrid1.DataSource.DataSet.Eof do
- begin
- cLine := '';
- for i := 0 to DBGrid1.FieldCount - 1 do
- begin
- cLine := cLine+DBgrid1.fields[i].asString+' ';
- end;
- WriteLn(BackUpFile, cLine);
- DBGrid1.DataSource.DataSet.Next;
- end;
- CloseFile(BackUpFile);
- end;
- Now this text file is like that:
- 123
- abc
- 567
- stu
- [and so on]
- But I want it like that:
- 123 abc
- 567 stu
- [and so on]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement