In computer science, a signal, variable, or marker that indicates a specific state, often as a binary switch (e.g., on/off, true/false).
example
Der Programmierer setzte eine Flag, um zu markieren, dass die Datei bereits bearbeitet wurde.
The programmer set a flag to mark that the file had already been processed.
Usage tips
Technical language and origin
'Die Flag' (the flag) is a technical term from computer science and a direct loanword from English. It is used almost exclusively in this technical context.
EXAMPLE
Dieser Code-Abschnitt ist nur für die Verarbeitung von Flags zuständig.
This section of code is only responsible for processing flags.
Typical verbs
In a programming context, a flag is typically combined with certain verbs. The most common are: 'eine Flag setzen' (to set a flag), 'eine Flag prüfen' or 'abfragen' (to check/query a flag), and 'eine Flag löschen' or 'zurücksetzen' (to clear/reset a flag).
EXAMPLE
Bevor die Daten gespeichert werden, müssen wir die Flag prüfen.
Before the data is saved, we need to check the flag.
How it works
A flag works like a digital switch or a note to store a state. Usually it has only two values, for example 'wahr' (true) or 'falsch' (false), to indicate whether a condition is met or not.
EXAMPLE
Wenn die Flag auf „wahr“ steht, ist der Benutzer angemeldet.
If the flag is set to 'true,' the user is logged in.
Compare with
near_synonym · confusable
Flag vs Signal
signal
'das Signal' and 'die Flag' can both indicate information in technical contexts. However, 'Signal' is much more general: it can transmit technical information, for example as an electrical or digital signal. 'Flag' is more specific and belongs mainly to computer science. It is a marker or variable that shows a state, often simply on or off, true or false. The words can be confused because a flag acts like a small signal in a program. Strictly speaking, however, a flag is not just any signal, but a specific state indicator.
Flag
Die Entwicklerin setzt eine Flag, damit das Programm den Fehler nur einmal meldet.
The developer sets a flag so that the program reports the error only once.
Signal
Das Signal vom Sensor kommt zu spät am Computer an.
The signal from the sensor reaches the computer too late.