{***********************************************************************}
{									}
{ __RetryFil  Set delay loops and number of retries on lock conflicts	}
{									}
{ procedure __RetryFil(TimeLoops,Retries : word;			}
{			   var ErrorCode : word);			}
{									}
{	      TimeLoops The number time a delay loop is executed	}
{			between each retry.				}
{	      Retries	Number of times to retry the locking code	}
{	      ErrorCode The returned error status code; values are:	}
{			(0) Requested change made			}
{			(1) Illegal function request (this is avail-	}
{			    able only for DOS 3.10 and later).		}
{			If DOS version 3.00 or later is used, a call to }
{			 __RetErUtl can be made to return more informa- }
{			tion on the error.				}
{									}
{ Description __RetryFil determines how often and how many times a	}
{	      call to access a file should be tried when a sharing or	}
{	      locking conflict is encountered.	The default values used }
{	      by DOS are 1 for Delay and 3 for Retries. 		}
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

procedure __RetryFil(TimeLoops,Retries : word;
			 var ErrorCode : word);

  var
    DOSVersion : word;
    Reg        : registers;

  begin {__RetryFil}

    { This function is available only for DOS 3.10 and later.  If an	}
    { earlier version is used, set the error code to 1 and exit.	}

    DOSVersion := __2WordSup(_DOSMajorVer,_DOSMinorVer);
    if (DOSVersion < $030A) then
       begin
	 ErrorCode := 1;
	 Exit
       end;

    with Reg do 		       { Call DOS IOCTL - function $B	}
      begin
	AX := $440B;		       { AH = $44 and AL = 0B		}
	CX := TimeLoops;
	DX := Retries;
	Intr(_DOS,Reg);
	if ((Flags and FCarry) <> 0) then
	   ErrorCode := AX
	else
	   ErrorCode := 0
      end

  end;	{__RetryFil}
