Autor Beitrag
rob87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Mo 04.12.06 14:35 
Hallo,


wie kann ich an eine Case-Auswahl mehrere Aufgaben bündeln??


Und wie kann ich hier meinen Delphi-Quelltext richtig einfügen? *g*
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 04.12.06 14:39 
Zitat:
wie kann ich an eine Case-Auswahl mehrere Aufgaben bündeln??


ausblenden Delphi-Quelltext
1:
2:
case <Variable> of
  <Wert1>, <Wert2> :...

_________________
Markus Kinzler.
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Mo 04.12.06 14:45 
Das funktioniert bei mir nicht


----------------------------




ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
case RG1.ItemIndex of
    0 : Form7.Visible := true, Form7.P1.Caption := 'Sie erreichen eine Weite von : ' +   IntToStr(ergebnis) + ' m.'
    1 : Form6.Visible := true;
    2 : Form6.Visible := true;
end;

Moderiert von user profile iconUGrohne: Delphi-Tags hinzugefügt
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 04.12.06 14:49 
Um in einem Case-Statement mehrere Anweisungen auszuführen, musst Du einen begin...end-Block verwenden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
case RG1.ItemIndex of
    0 : 
      begin 
        Form7.Visible := true;
        Form7.P1.Caption := 'Sie erreichen eine Weite von : ' +   IntToStr(ergebnis) + ' m.';
      end;
    1 : Form6.Visible := true;
    2 : Form6.Visible := true;
end;


Um im Forum Delphi-Code einzufügen, schließt Du den Code einfach in die Delphi-Tags ein:
ausblenden Quelltext
1:
<span class="inlineSyntax"><span class="codecomment">{PROTECTTAG569e75c5e3af404fee881b36c385bff5}</span></span>					


Schau aber auch einfach mal in die Hilfe
crowley
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 406

Win XP, Win Vista, Mandriva, Ubuntu
Delphi 4-8, Delphi 2006, Delphi 2007
BeitragVerfasst: Mo 04.12.06 14:49 
Huhu user profile iconrob87

Versuch es doch mal mit:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  case RG1.ItemIndex of
    0 : begin 
          Form7.Visible := true;
          Form7.P1.Caption := 'Sie erreichen eine Weite von : ' +   IntToStr(ergebnis) + ' m.'
        end;
    1 : Form6.Visible := true;
    2 : Form6.Visible := true;
  end;



Gruss,

C.