|
Registriert seit: 5. Mär 2013 502 Beiträge Delphi 7 Enterprise |
#3
Ich zeigt dir mal nen beispielcode aus meinem "Prog"
Aber nicht erschrecken lol
Delphi-Quellcode:
procedure TForm1.LMDSpeedButton2Click(Sender: TObject);
var gesamtzahl,gesamtzahl1,gesamtzahl2,gesamtzahl3,gesamtzahl4, gesamtzahl5,gesamtzahl6,gesamtzahl7,gesamtzahl8, gesamtzahl9,gesamtzahl12,gesamtzahl13,gesamtzahl14,gesamtzahl15, gesamtzahl16,gesamtzahl17,gesamtzahl18,gesamtzahl19,gesamtzahl20, gesamtzahl21,gesamtzahl22,gesamtzahl23,gesamtzahl24, gesamtzahl25,gesamtzahl26,gesamtzahl27,gesamtzahl28, gesamtzahl31,gesamtzahl32,gesamtzahl33,gesamtzahl34, gesamtzahl35,gesamtzahl36,gesamtzahl37,gesamtzahl38,gesamtzahl39, gesamtzahl41,gesamtzahl42,gesamtzahl43,gesamtzahl44, gesamtzahl45,gesamtzahl46,gesamtzahl47,gesamtzahl48,gesamtzahl49: double; i:integer; s : String; e: array of char; begin for i:=1 to eltreestringgrid1.RowCount-1 do begin if eltreestringgrid1.cells[5,i]='2110' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='2110' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='2110' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='2110' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='2110' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='2110' then gesamtzahl:=gesamtzahl + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='2110' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='3221' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='3221' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='3221' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='3221' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='3221' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='3221' then gesamtzahl1:=gesamtzahl1 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='3221' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='2303' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='2303' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='2303' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='2303' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='2303' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='2303' then gesamtzahl2:=gesamtzahl2 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='2303' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='2400' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='2400' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='2400' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='2400' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='2400' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='2400' then gesamtzahl3:=gesamtzahl3 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='2400' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='2750' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='2750' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='2750' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='2750' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='2750' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='2750' then gesamtzahl6:=gesamtzahl6 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='2750' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='2900' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='2900' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='2900' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='2900' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='2900' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='2900' then gesamtzahl7:=gesamtzahl7 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='2900' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='4110' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='4110' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='4110' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='4110' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='4110' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='4110' then gesamtzahl12:=gesamtzahl12 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='4110' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='4150' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='4150' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='4150' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='4150' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='4150' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='4150' then gesamtzahl13:=gesamtzahl13 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='4150' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='4230' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='4230' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='4230' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='4230' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='4230' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='4230' then gesamtzahl14:=gesamtzahl14 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='4230' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='4900' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='4900' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='4900' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='4900' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='4900' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='4900' then gesamtzahl17:=gesamtzahl17 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='4900' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='5020' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='5020' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='5020' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='5020' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='5020' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='5020' then gesamtzahl21:=gesamtzahl21 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='5020' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='5250' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='5250' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='5250' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='5250' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='5250' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='5250' then gesamtzahl22:=gesamtzahl22 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='5250' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='5872' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='5872' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='5872' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='5872' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='5872' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='5872' then gesamtzahl24:=gesamtzahl24 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='5872' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='5650' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='5650' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='5650' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='5650' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='5650' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='5650' then gesamtzahl25:=gesamtzahl25 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='5650' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='8028' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='8028' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='8028' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='8028' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='8028' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='8028' then gesamtzahl41:=gesamtzahl41 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='8028' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='7100' then Length(eltreestringgrid1.Cells[2,i]); if eltreestringgrid1.cells[5,i]='7100' then s := eltreestringgrid1.Cells[2,i]; if eltreestringgrid1.cells[5,i]='7100' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='7100' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='7100' then eltreestringgrid1.Cells[2,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='7100' then gesamtzahl42:=gesamtzahl42 + strtofloat(eltreestringgrid1.cells[2,i]); if eltreestringgrid1.cells[5,i]='7100' then eltreestringgrid1.Cells[2,i]:=eltreestringgrid1.Cells[2,i]+' €' else; if eltreestringgrid1.cells[5,i]='8150' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='8150' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='8150' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='8150' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='8150' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='8150' then gesamtzahl45:=gesamtzahl45 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='8150' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; if eltreestringgrid1.cells[5,i]='7358' then Length(eltreestringgrid1.Cells[3,i]); if eltreestringgrid1.cells[5,i]='7358' then s := eltreestringgrid1.Cells[3,i]; if eltreestringgrid1.cells[5,i]='7358' then setlength(e,length(s)-2); if eltreestringgrid1.cells[5,i]='7358' then copymemory(e,@s[1],length(e)); if eltreestringgrid1.cells[5,i]='7358' then eltreestringgrid1.Cells[3,i]:=(string(e)); if eltreestringgrid1.cells[5,i]='7358' then gesamtzahl46:=gesamtzahl46 + strtofloat(eltreestringgrid1.cells[3,i]); if eltreestringgrid1.cells[5,i]='7358' then eltreestringgrid1.Cells[3,i]:=eltreestringgrid1.Cells[3,i]+' €' else; end; Form9.Label2110.Caption := 'Mitgliedsbeiträge:'; Form9.Edit1.text := Format('%f €', [Gesamtzahl]); Form9.Label3221.Caption := 'Spenden:'; Form9.Edit2.text := Format('%f €', [Gesamtzahl1]); Form9.Label2303.Caption := 'Zuschüsse:'; Form9.Edit3.text := Format('%f €', [Gesamtzahl2]); Form9.Label2400.Caption := 'sonstige Einnahmen:'; Form9.Edit4.text := Format('%f €', [Gesamtzahl3]); Gesamtzahl4 := Gesamtzahl + Gesamtzahl1 + Gesamtzahl2 + Gesamtzahl3; Form9.LabelGesamt.Caption := 'Summe Einnahmen:'; Form9.Edit5.text := Format('%f €', [Gesamtzahl4]); Gesamtzahl5:=0; Form9.Edit6.text := Format('%f €', [Gesamtzahl5]); Form9.Edit7.text := Format('%f €', [Gesamtzahl6]); Form9.Edit8.text := Format('%f €', [Gesamtzahl7]); Gesamtzahl8 := Gesamtzahl5 + Gesamtzahl6 + Gesamtzahl7; Form9.Edit9.text := Format('%f €', [Gesamtzahl8]); Form9.Edit10.text := Format('%f €', [Gesamtzahl8]); Gesamtzahl9 := Gesamtzahl4-Gesamtzahl8; Form9.Edit21.text:=floattostr(gesamtzahl9); Form9.Edit11.text := Format('%f €', [Gesamtzahl9]); Form9.Edit12.text := Format('%f €', [Gesamtzahl12]); Form9.Edit13.text := Format('%f €', [Gesamtzahl13]); Form9.Edit14.text := Format('%f €', [Gesamtzahl14]); Gesamtzahl15 := Gesamtzahl12 + Gesamtzahl13 + Gesamtzahl14; Form9.Edit15.text := Format('%f €', [Gesamtzahl15]); Gesamtzahl16:=0; Form9.Edit16.text := Format('%f €', [Gesamtzahl16]); Form9.Edit17.text := Format('%f €', [Gesamtzahl17]); Gesamtzahl18 := Gesamtzahl16 + Gesamtzahl17; Form9.Edit18.text := Format('%f €', [Gesamtzahl18]); Gesamtzahl19 := Gesamtzahl18; Form9.Edit19.text := Format('%f €', [Gesamtzahl19]); Gesamtzahl20 := Gesamtzahl15-Gesamtzahl18; Form9.Edit22.text:=floattostr(gesamtzahl20) ; Form9.Edit20.text := Format('%f €', [Gesamtzahl20]); Form10.Edit1.text := Format('%f €', [Gesamtzahl21]); Form10.Edit2.text := Format('%f €', [Gesamtzahl22]); Gesamtzahl23 := Gesamtzahl21 + Gesamtzahl22; Form10.Edit3.text := Format('%f €', [Gesamtzahl23]); Form10.Edit4.text := Format('%f €', [Gesamtzahl24]); Form10.Edit5.text := Format('%f €', [Gesamtzahl25]); Gesamtzahl26 := Gesamtzahl24 + Gesamtzahl25; Form10.Edit6.text := Format('%f €', [Gesamtzahl26]); Form10.edit7.text := Format('%f €', [Gesamtzahl26]); Gesamtzahl27 := Gesamtzahl23 - Gesamtzahl26; Form10.Edit9.text:=floattostr(gesamtzahl27); Form10.edit8.text := Format('%f €', [Gesamtzahl27]); Form11.edit1.text := Format('%f €', [Gesamtzahl31]); Form11.edit2.text := Format('%f €', [Gesamtzahl32]); Form11.edit3.text := Format('%f €', [Gesamtzahl33]); Form11.edit4.text := Format('%f €', [Gesamtzahl34]); Form11.edit5.text := Format('%f €', [Gesamtzahl35]); Form11.edit6.text := Format('%f €', [Gesamtzahl36]); Form11.edit7.text := Format('%f €', [Gesamtzahl37]); Form11.edit8.text := Format('%f €', [Gesamtzahl38]); Form11.Edit10.text:=floattostr(gesamtzahl39); Form11.edit9.text := Format('%f €', [Gesamtzahl39]); Form12.edit1.text := Format('%f €', [Gesamtzahl41]); Form12.edit2.text := Format('%f €', [Gesamtzahl42]); gesamtzahl43 := Gesamtzahl41 + Gesamtzahl42; Form12.edit3.text := Format('%f €', [Gesamtzahl43]); Form12.edit4.text := Format('%f €', [Gesamtzahl44]); Form12.edit5.text := Format('%f €', [Gesamtzahl45]); Form12.edit6.text := Format('%f €', [Gesamtzahl46]); gesamtzahl47 := Gesamtzahl44 + Gesamtzahl45 + Gesamtzahl46; Form12.edit7.text := Format('%f €', [Gesamtzahl47]); Form12.edit8.text := Format('%f €', [Gesamtzahl47]); Gesamtzahl48 := Gesamtzahl43 - Gesamtzahl47; Form12.Edit10.text:=floattostr(gesamtzahl48); Form12.edit9.text := Format('%f €', [Gesamtzahl48]); Form13.Show; end; Nun will ich den gesamtzahl variablen allen den Wert 0 zuweisen damit auch der Compiler nicht mehr meckert wie gesamtzahl1 meight have not been intialized. So und nun meckert über den langen code und wie versaut er ist... lol ![]() |
![]() |
Ansicht |
![]() |
![]() |
![]() |
ForumregelnEs ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.
BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus. Trackbacks are an
Pingbacks are an
Refbacks are aus
|
|
Nützliche Links |
Heutige Beiträge |
Sitemap |
Suchen |
Code-Library |
Wer ist online |
Alle Foren als gelesen markieren |
Gehe zu... |
LinkBack |
![]() |
![]() |