Thema: Delphi Bedingte Bedingung

Einzelnen Beitrag anzeigen

Benutzerbild von nailor
nailor

Registriert seit: 12. Dez 2002
Ort: Karlsruhe
1.989 Beiträge
 
#1

Bedingte Bedingung

  Alt 24. Feb 2003, 14:58
Delphi-Quellcode:
var a,b,c,res: boolean;
begin

if a then
  res := b and c
else
  res := b;

if res then
  ...

end;
geht das auch in eine Zeile, nach dem Motto

Delphi-Quellcode:
var a,b,c,res: boolean;
begin

if (res := if a then (b and c) else b) then
  ...

end;
Michael N.
http://nailor.devzero.de/code/sharpmath/testing/ --- Tests, Feedback, Anregungen, ... aller Art sehr willkommen!
::: don't try so hard - it'll happen for a reason :::
  Mit Zitat antworten Zitat