Not/de
Deutsch · English · Français · Suomi · Русский
Zurück zu den reservierten Wörtern.
Das reservierte Wort not kann verwendet werden als:
- negation eines booleschen Ausdrucks
- binäre Negation eines Wertes
Beispiel für die Negation eines booleschen Ausdrucks:
var
intI: Integer;
begin
...
if not (intI > 2) then ; // Durch das Reservierte Wort not wird das Ergebnis in sein Gegenteil verkehrt
// Ist das Ergebnis in der Klammer True dann liefert der not-Operator False
// Ist das Ergebnis in der Klammer False dann liefert der not-Operator True
...
end;Beispiel für die binäre Negation eines Wertes:
Binärdarstellung der Zahl 3: 0000 0011 Mit dem reservierten Wort not wird der Binärwert umgedreht: 1111 1100
var
intI: Integer;
begin
...
intI := ...;
... := not intI; // Dreht den binären Wert der Variablen intI um
...
end;From the Free Pascal wiki, page "Not/de", as it stood on 2020-02-21 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
