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



BeitragVerfasst: Do 27.01.05 23:01 
Habe folgendes Problem.
Wenn ich die .exe mit folgendem Script ausführe

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if ComboBox1.ItemIndex=11 then
        begin
          SpinEdit1.Value:=SpinEdit1.Value+1;
          ComboBox1.ItemIndex:=ComboBox1.ItemIndex-11;
        end

und als fehlermeldung kommt
In Projekt Project1 ist eine Exception der Klasse EStackOverflow aufgetreten. Meldung: 'Stack-Überlauf' ...
und er springt in die Zeile:
ComboBox1.ItemIndex:=ComboBox1.ItemIndex-11;
ich versteh allerdings nicht was daran falsch sein soll, denn dannach sollte ComboBox1.ItemIndex = 0 sein.
mfg anT1q

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 27.01.05 23:13 
Ein bisschen mehr Code wärenicht schlecht. Ich tippe darauf, dass du noch irgendwo ne Schleife verborgen hast?!
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: Do 27.01.05 23:21 
Wie sieht denn deine ComboBox1.OnChange und SpinEdit1.OnChange aus?

_________________
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.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 27.01.05 23:33 
so wie ich das sehe könntest du auch gleichComboBox1.ItemIndex:=0; schreiben, aber du wirst deine gründe haben... Stack.Overflow ist so ne sache.. kenn ich mich garnict mit aus...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
anT1q Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Fr 28.01.05 00:51 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm1.NextClick(Sender: TObject);
begin
      if ComboBox1.ItemIndex=-1 then
      begin
      ComboBox1.ItemIndex:=0;
      end
      else
      begin
        if ComboBox1.ItemIndex=11 then
        begin
          SpinEdit1.Value:=SpinEdit1.Value+1;
          ComboBox1.ItemIndex:=ComboBox1.ItemIndex-11;
        end
        else
        begin
          ComboBox1.ItemIndex:=ComboBox1.ItemIndex+1;
        end;
      end;
      ergebnis:= Lastday(ComboBox1.ItemIndex,SpinEdit1.Value);
      Kalender(Sender,ergebnis);
end;

jojo, klar da könnte ich auch ComboBox1.ItemIndex=0 schreiben, hatte es auch schon da stehen, ging aber auch nicht!
also das kann irgendein dummer fehler sein, ich hab grad erst mit delphi angefangen und kenn mich noch gar ned damit aus.
nur java kenntnisse hald ;)

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Fr 28.01.05 00:59 
Der Fehler wird wohl in deinen Funktionen LastDay oder Kalender liegen.

_________________
Ciao, Sprint.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 28.01.05 14:00 
Würde ich auch sagen. Ist eine von den beiden Funktionen evtl. rekursiv programmiert? Darauf deutet nämlich der Stack-Überlauf hin. Wahrscheinlich bricht die Rekursion einfach nicht ab.

_________________
We are, we were and will not be.