This is an indicator that has two states, often called set or unset. It enables the program to record whether a particular event has occurred, for example whether (or not) a list of numbers has been sorted, whether an interrupt has been detected (or not detected). In a high-level language a variable may be used as a flag. If a Boolean or logical data type is used, the two states, true and false, are equivalent to the flag states set and unset. To begin with the flag may be unset (false) and when a particular case is detected it is set (true); when the action has been completed it is unset again (back to false).