The following code is available:
TShape = class private FStart: TPoint; FColor: TColor; procedure Draw; virtual; abstract; procedure SetStart(x, y: Integer); procedure SetColor(color: TColor); public constructor Create(x, y: Integer; color: TColor); property Start: TPoint write FStart; property Color: TColor write FColor; end; TLine = class(TShape) private FPoints: TPointArray; procedure Draw; override; procedure AddPoint(p: TPoint); function GetPoints: TPointArray; public constructor Create(x, y: Integer); property Points: TPointArray read FPoints write FPoints; end; constructor TLine.Create(x, y: Integer); begin SetLength(FPoints, 1); FPoints[0].x := x; FPoints[0].y := y; end; procedure TLine.Draw; begin TFrm.PaintBox.Canvas.Polyline(FPoints); end; procedure TLine.AddPoint(p: TPoint); begin SetLength(FPoints, Length(FPoints)+1); FPoints[High(FPoints)] := p; end; function TLine.GetPoints: TPointArray; begin Result := FPoints; end; procedure TShape.SetStart(x, y: Integer); begin FStart.X := x; FStart.Y := y; end; procedure TTFrm.PaintBoxMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: integer); begin isDrawing := true; SetLength(shapes, Length(shapes)+1); case instrument of 1: shapes[High(shapes)] := TLine.Create(x, y); end; end; procedure TTFrm.PaintBoxMouseMove(Sender: TObject; Shift: TShiftState; X, Y: integer); var p: TPoint; begin if not isDrawing then exit; pX := x; pY := y;<br> case instrument of 1: begin SetLength(shapes[High(shapes)].Points, Length(shapes[High(shapes)].Points)+1); shapes[High(shapes)].Points[High(Points)] := p; end; end; end; When trying to compile, it produces errors at the place of access to the Points array in the MouseMove:"main.pas(168,28)
Error: identifier idents no member "Points" "
What's my mistake?