В ЧЕМ ОШИБКА???
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
type
{ TForm1 }
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormPaint(Sender: TObject);
var
a:textfile;
x1,y1,x2,y2:integer;
PenColor,
FontSize:integer;
ch:char;
s:string;
begin
AssignFile(a,'data.txt');
Reset(a);
with Canvas do
while not EOF(a) do begin
Read(a,ch);
'C':begin
Readln(a,PenColor);
Pen.Color:=PenColor;
end;
'c':begin
Readln(a,BrushColor);
Brush.Color:=BrushColor;
end;
'R':begin
Readln(a,x1,y1,x2,y2);
RectAngle(x1,y1,x2,y2);
end;
'T':begin
Readln(a,x1,y1,s);
s:=Erase(s);
Text.Out(x1,y1,s);
end;
'S':begin
Readln(a,FontSize);
Font.Size:=FontSize;
end;
's':begin
Readln(a,s);
s:=EraseSpace(s);
Brush.Style:-SetBrushStyle(S);
end;
end;
end;
CloseFile(a);
end;
functio EraseSpace(s:string):string;
begin
while(Length(s)>0)and(s[1]='')do Delete (s,1,1);
Result:=s;
end;
end.