PascalScript: Fix Wait() with negative values.

This commit is contained in:
Merlijn Wajer 2011-01-09 15:12:42 +01:00
parent a52b164f34
commit d75f7d55cf
1 changed files with 7 additions and 1 deletions

View File

@ -40,12 +40,18 @@ end;
procedure ps_Wait(t: Integer); extdecl;
{$ifdef MSWINDOWS}
begin
Sleep(t);
if t < 0 then
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t])
else
Sleep(t);
end;
{$else}
var
EndTime : DWord;
begin
if t < 0 then
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t]);
if t > 50 then
begin;
EndTime := GetTickCount + t;