unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Diagramm: TPaintBox;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure MesswerteZeichnen;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var n:integer;
var Messwerte:
array of integer;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
inc(n);
setlength (messwerte,n+1);
Messwerte[n] := random(10);
MesswerteZeichnen;
end;
procedure MesswerteZeichnen;
var x_real,k:integer;
begin
x_real := 40+k;
Diagramm.Canvas.Pen.style := pssolid;
Diagramm.Canvas.Pen.Color := clblue;
Diagramm.Canvas.LineTo(x_real,Messwerte[n]);
k:=+1;
end;