{***********************************************************************}
{									}
{ __HandlFil  Return the file handle associated with a Pascal file	}
{									}
{ function  __HandlFil(var FileVar) : word;				}
{									}
{	      FileVar	File variable (of any type).  Notice that this	}
{			is an untyped parameter.			}
{									}
{ Description A file variable is really a record structure either of	}
{	      type FileRec or TextRec.	When a file is opened, among	}
{	      other information, the DOS file handle is stored in the	}
{	      structure.  This function returns the file handle ($FFFF	}
{	      if the file is not open) for a specified Pascal file	}
{	      variable as the function value.				}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

function __HandlFil(var FileVar) : word;

  begin {__HandlFil}

    if (FileRec(FileVar).Mode = fmClosed) then
       __HandlFil := $FFFF
    else
       __HandlFil := FileRec(FileVar).Handle

  end;	{__HandlFil}
