Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.240 Beiträge
 
Delphi 12 Athens
 
#7

AW: Unterschied zwischen "not" und "false"?

  Alt 11. Aug 2010, 15:20
Delphi-Quellcode:
var b: Boolean;
begin
  Memo1.Lines.Add('');
  Memo1.Lines.Add('b := false;');
  b := false;
  if b then Memo1.Lines.Add('if b then');
  if not b then Memo1.Lines.Add('if not b then');
  if b = false then Memo1.Lines.Add('if b = false then');
  if b = true then Memo1.Lines.Add('if b = true then');

  Memo1.Lines.Add('');
  Memo1.Lines.Add('b := true;');
  b := true;
  if b then Memo1.Lines.Add('if b then');
  if not b then Memo1.Lines.Add('if not b then');
  if b = false then Memo1.Lines.Add('if b = false then');
  if b = true then Memo1.Lines.Add('if b = true then');

  Memo1.Lines.Add('');
  Memo1.Lines.Add('b := 3;');
  b := Boolean(3);
  if b then Memo1.Lines.Add('if b then');
  if not b then Memo1.Lines.Add('if not b then');
  if b = false then Memo1.Lines.Add('if b = false then');
  if b = true then Memo1.Lines.Add('if b = true then');
end;
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat