Autor Beitrag
dErWiWiE
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 05.04.05 18:03 
Hey Leute!
Ich erhalte bei folgendem Code eine EConvertError Exception. Ich verstehe allerdings nicht, wieso...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  var
  x,i : integer;
  ..
  ..
  ..
  For x:=0 To Epo_Anzahl Do
   Begin
    Epo_Summe := Epo_Summe + StrToInt(SG_Epos.rows[i].Strings[1]);
    i:=i+1;
   End;



Vielen Dank für Hilfe!

mfg dErWiWiE

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: Di 05.04.05 18:12 
Könnte es sein, dass es for I := 0 to Anzahl - 1 do heißen müsste?

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
dErWiWiE Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 05.04.05 18:16 
du hast recht! mit -1 klappt es, und ist ja auch total logisch... Denn so versucht er in ein nichtvorhandenes Gridfeld zuzugreifen.

Vielen Dank für die schnelle Hilfe!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 05.04.05 18:17 
wenn du einen convert error bkommst dann wird es wohl an dem StrToInt liegen.
schau mal ob in dem was du da von einem string in eien integer verwandeln willst auch wirklich eine zahl drin steht.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 05.04.05 18:21 
Was steht denn in deiner StringGrid?
Sind alle Zellen, die angesprochen werden auch wirklich Zahlen?

Tip: StrToIntDef

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.