Entwickler-Ecke

Grafische Benutzeroberflächen (VCL & FireMonkey) - Mehrere Aufgaben nach Case-Auswahl


rob87 - Mo 04.12.06 14:35
Titel: Mehrere Aufgaben nach Case-Auswahl
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 - Mo 04.12.06 14:39

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



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


rob87 - Mo 04.12.06 14:45

Das funktioniert bei mir nicht


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





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 - Mo 04.12.06 14:49

Um in einem Case-Statement mehrere Anweisungen auszuführen, musst Du einen begin...end-Block verwenden:

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:

Quelltext
1:
<span class="inlineSyntax"><span class="codecomment">{PROTECTTAG569e75c5e3af404fee881b36c385bff5}</span></span>                    


Schau aber auch einfach mal in die Hilfe [http://www.delphi-forum.de/help_schreiben_bbcodes.html&sub=,19,27&popup=1]


crowley - Mo 04.12.06 14:49

Huhu user profile iconrob87

Versuch es doch mal mit:


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.