1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111:
| unit planetendaten;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,umehrkoerper, ExtCtrls;
type TForm5 = class(TForm) Button1: TButton; Button2: TButton; Label1: TLabel; Label2: TLabel; planetfest: TCheckBox; Label3: TLabel; Label4: TLabel; x: TLabeledEdit; y: TLabeledEdit; Vx: TLabeledEdit; Vy: TLabeledEdit; Masse: TLabeledEdit; procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private i:integer; public anzahlaufruf:boolean; vxarray,vyarray,xarray,yarray,massearray:zahlenarray; festarray:boolarray; end;
var Form5: TForm5;
implementation
uses Zeichenfenster, konstanten;
{$R *.dfm}
type zahlenarray = array of extended; boolarray = array of boolean;
procedure TForm5.Button2Click(Sender: TObject); begin setlength(vxarray,0); setlength(vyarray,0); setlength(xarray,0); setlength(yarray,0); setlength(massearray,0); setlength(festarray,0); i:=0; vx.text:=''; vy.text:=''; x.text:=''; y.text:=''; masse.text:=''; planetfest.Checked:=false; close; end;
procedure TForm5.Button1Click(Sender: TObject); begin if i<form1.anzahl-1 then begin vxarray[i]:=StrToFloat(vx.text); vyarray[i]:=StrToFloat(vy.text); xarray[i]:=StrToFloat(x.text); yarray[i]:=StrToFloat(y.text); massearray[i]:=abs(strtofloat(masse.text)); festarray[i]:=planetfest.checked; end else begin form1.mk:=tmehrkoerper.create(vxarray,vyarray,xarray,yarray,massearray,festarray); form1.visible:=true; close; end;
vx.text:=''; vy.text:=''; x.text:=''; y.text:=''; masse.text:=''; planetfest.Checked:=false; i:=i+1; end;
procedure TForm5.FormShow(Sender: TObject); begin if anzahlaufruf then begin setlength(vxarray,form1.anzahl); setlength(vyarray,form1.anzahl); setlength(xarray,form1.anzahl); setlength(yarray,form1.anzahl); setlength(massearray,form1.anzahl); setlength(festarray,form1.anzahl); i:=0; anzahlaufruf:=false; end; end;
procedure TForm5.FormCreate(Sender: TObject); begin anzahlaufruf:=false; i:=0; end;
end. |