![]() |
|
|
|||||||
| Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
|
|
Опции темы | Поиск в этой теме | Опции просмотра |
|
#1
|
|||
|
|||
|
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
OpenDialog1.Execute;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
AFile:textFile;
Field,data,vals:Tstringlist;
i:integer;
line,line1,rec:string;
Potok:TStringStream;
begin
Field:=TStringList.Create;
data:=TStringlist.Create;
Potok:=TStringStream.Create(rec);
try
begin
Assignfile(Afile,openDialog1.FileName);
Reset(Afile);
While not (AFile) do
begin
Readln(AFile,rec);
potok.WriteString(rec);
end;
end;
System.CloseFile(Afile);
line:=Potok.DataString;
line1:=Stringreplace(line,')))','^',[rfReplaceall]);
line:=stringReplace(line1,' ','_',[rfReplaceall]);
field.Clear;
data.Clear;
vals.Clear;
Field.Delimiter:='^';
Vals.Delimiter:='|';
Data.Delimiter:='=';
Field.DelimitedText:=line;
memo1.Lines.Append(line);
end.-------------------------ошибки------------------------------- Build [Error] Unit1.pas(51): Operator not applicable to this operand type [Error] Unit1.pas(69): EXCEPT or FINALLY expected [Error] Unit1.pas(71): 'END' expected but end of file found [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas' ---------------------------------P.S---------------- Благодарю за помощь Последний раз редактировалось Admin, 12.12.2008 в 10:12. |