Einzelnen Beitrag anzeigen

fr0g

Registriert seit: 11. Dez 2006
28 Beiträge
 
#1

Frage zur Kürzung des Quelltextes

  Alt 11. Dez 2006, 18:44
Also ich bin dabei ein Automatisches Lagersystem zu programmieren.
jedenfalls Gibt es dort import und Export.
Der Quelltext sieht bis jetzt so aus:
Delphi-Quellcode:
VAR a,b,x,auswahl:integer;

implementation

{$R *.dfm}

procedure TForm1.bokClick(Sender: TObject);
begin
if sender=biok then begin auswahl:=cbimport.ItemIndex+1; end;
if sender=beok then begin auswahl:=cbexport.ItemIndex+1; end;

if auswahl=1 then a:=StrToInt(leres1.Text); {kürzen!!}
if auswahl=2 then a:=StrToInt(leres2.Text);
if auswahl=3 then a:=StrToInt(leres3.Text);
if auswahl=4 then a:=StrToInt(leres4.Text);
if auswahl=5 then a:=StrToInt(leres5.Text);
if auswahl=6 then a:=StrToInt(leres6.Text);
if auswahl=7 then a:=StrToInt(leres7.Text);
if auswahl=8 then a:=StrToInt(leres8.Text);
if auswahl=9 then a:=StrToInt(leres9.Text);

if sender=biok then begin b:=StrToInt(eibase.Text); x:=a+b; end;
if sender=beok then begin b:=StrToInt(eebase.Text); x:=a-b; end;

if auswahl=1 then leres1.Text:=IntToStr(x); {kürzen!!}
if auswahl=2 then leres2.Text:=IntToStr(x);
if auswahl=3 then leres3.Text:=IntToStr(x);
if auswahl=4 then leres4.Text:=IntToStr(x);
if auswahl=5 then leres5.Text:=IntToStr(x);
if auswahl=6 then leres6.Text:=IntToStr(x);
if auswahl=7 then leres7.Text:=IntToStr(x);
if auswahl=8 then leres8.Text:=IntToStr(x);
if auswahl=9 then leres9.Text:=IntToStr(x);
end;
Jetzt würde ich gerne noch die Bereiche wo kürzen steht kürzen mit FindComponent. Jedoch krieg ich das irgdenwie nicht hin das ich FindComponent so umschreibe das ich den inhalt eines Edit Feldes nicht in eine Variable vom typ integer bekomme
  Mit Zitat antworten Zitat