Синхронизация скриптов LUA с QUIKSharp. Внесение в ReadMe информации об ошибках core.dll / LUA скриптов

This commit is contained in:
cia76
2022-09-25 17:33:59 +05:00
parent 4835c35906
commit c2f92a6931
3 changed files with 162 additions and 4 deletions

View File

@@ -127,7 +127,7 @@ function log(msg, level)
end
end
-- Doesn't work if string contains empty values, eg. 'foo,,bar'. You get {'foo','bar'} instead of {'foo', '', 'bar'}
function split(inputstr, sep)
if sep == nil then
sep = "%s"
@@ -141,6 +141,18 @@ function split(inputstr, sep)
return t
end
-- https://stackoverflow.com/questions/1426954/split-string-in-lua#comment73602874_7615129
function split2(inputstr, sep)
sep = sep or '%s'
local t = {}
for field, s in string.gmatch(inputstr, "([^"..sep.."]*)("..sep.."?)") do
table.insert(t, field)
if s == "" then
return t
end
end
end
function from_json(str)
local status, msg= pcall(json.decode, str, 1, json.null) -- dkjson
if status then