unit Kurve;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
PaintBox1: TPaintBox;
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses csCSV;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
csvReader : TCSVReader;
sData : TFileStream;
i : integer;
Begin
sData := TFileStream.Create('
H:\Werte.CSV',fmOpenRead);
csvReader := TCSVReader.Create (sData, '
;');
csvReader.First;
// Nach Änderung auf Veranlassung von Grenzgaenger nun notwendig. Dank an 'deadcandance'
Try
While not csvReader.Eof
Do Begin
For i:=0
to csvReader.ColumnCount - 1
Do
ListBox1.Items.Add (csvReader.Columns[i]);
csvReader.Next;
End;
Finally
csvReader.Free;
sData.Free;
End;
End;
procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
begin
for i:=0
to Listbox1.items.Count-1
do
begin
with Paintbox1.Canvas
do
begin
if i=0
then MoveTo(((i+1)*30),(500-(StrToInt(ListBox1.Items.Strings[i])*5)));
if i>0
then LineTo(((i+1)*30),(500-(StrToInt(ListBox1.Items.Strings[i])*5)));
end;
end;
end;
end.