ADD: Sleep function to Lua

This commit is contained in:
Alexander Koblov 2016-11-19 09:19:56 +00:00
commit cd4b00c7a5

View file

@ -37,6 +37,12 @@ implementation
uses
Forms, Dialogs, LazUTF8, DCOSUtils, fMain, uFormCommands, uOSUtils, uGlobs;
function luaSleep(L : Plua_State) : Integer; cdecl;
begin
Result:= 0;
Sleep(lua_tointeger(L, 1));
end;
function luaFileGetAttr(L : Plua_State) : Integer; cdecl;
begin
Result:= 1;
@ -90,6 +96,7 @@ end;
procedure RegisterPackages(L: Plua_State);
begin
lua_newtable(L);
luaP_register(L, 'Sleep', @luaSleep);
luaP_register(L, 'FileExists', @luaFileExists);
luaP_register(L, 'FileGetAttr', @luaFileGetAttr);
luaP_register(L, 'DirectoryExists', @luaDirectoryExists);