{***********************************************************************}
{									}
{ __CBrkUtl   Inspect and alter the Ctrl/Break flag			}
{									}
{ function  __CBrkUtl(SetFlag,Flag : boolean) : boolean;		}
{									}
{	      SetFlag	If TRUE, the Ctrl/Break check flag is set;	}
{			otherwise its current value is just returned.	}
{	      Flag	If SetFlag is TRUE, the Ctrl/Break check flag	}
{			is set to this value; otherwise the parameter	}
{			is ignored.					}
{									}
{ Description During all standard I/O operations, DOS checks for a	}
{	      Ctrl/Break key sequence.	If the Ctrl/Break flag is set	}
{	      to TRUE, DOS, in addition to standard I/O operations,	}
{	      checks for the sequence during most DOS function		}
{	      requests.  __CBrkUtl returns the current flag setting as	}
{	      the function value, and if SetFlag is TRUE, sets the flag }
{	      to value specified in Flag.				}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

function __CBrkUtl(SetFlag,Flag : boolean) : boolean;

  var
    Reg : registers;

  begin {__CBrkUtl}

    with Reg do 		       { Function $33 (Ctrl/Break Check)}
      begin
	AH := $33;
	if (SetFlag) then
	   begin
	     AL := 1;		       { Set the Ctrl/Break flag	}
	     if (Flag) then	       { to ON..			}
		DL := 1
	     else
		DL := 0 	       { to OFF..			}
	   end
	else
	   AL := 0;		       { Just return the flag value	}

	Intr(_DOS,Reg);
	__CBrkUtl := (DL = 1)
      end

  end;	{__CBrkUtl}
