{***********************************************************************}
{									}
{ __PauseKey  Display a message and wait for a keystroke		}
{									}
{ function  __PauseKey(Message : string) : word;			}
{									}
{	      Message	The optional message to be output.  The message }
{			is only displayed if the length of the string	}
{			is nonzero.					}
{									}
{ Description This function outputs a message (optional) and then the	}
{	      text   "Press any key to continue ... ".	After a key is	}
{	      is typed, control is returned with the character and the	}
{	      scan code as the function value, with the scan code in	}
{	      high byte and the character in the low byte.  The 	}
{	      function value can be type cast to _KeySeq as well.	}
{	      __PauseKey first flushes the keyboard buffer, and then	}
{	      waits for a key to be pressed (using __ExInKey).		}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc. 1987		}
{_______________________________________________________________________}

function __PauseKey(Message : string) : word;

  var
    RetChar  : char;
    ScanCode : byte;

  begin {__PauseKey}

    if (Length(Message) > 0) then
       Writeln(Message);	       { Display the message, and then	}
    Write('Press any key to continue ...');	{ the text.		}
    __FFlshKey; 				{ Flush the keyboard	}
    RetChar    := __ExInKey(TRUE,ScanCode);	{ Wait for a keystroke	}
    __PauseKey := __2WordSup(ScanCode,byte(RetChar))

  end;	{__PauseKey}
