-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.lua
More file actions
38 lines (31 loc) · 855 Bytes
/
Utils.lua
File metadata and controls
38 lines (31 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
IBScript.Utils = {}
function IBScript.Utils.PrintTable(table)
local text = "{";
for _, value in ipairs(table) do
if type(value) ~= "table" then
text = text.." "..value..",";
else
text = text.."{"
for _, value1 in ipairs(value) do
if type(value1) ~= "table" then
text = text.." "..value1..",";
end
end
text = text.."}"
end
end
return text.."}";
end
function IBScript.Utils.PrintIndexedTable(table)
local text = "";
for key, value in pairs(table) do
text = text..key..": "..tostring(value).."\n";
end
return text;
end
function IBScript.Utils.ReadFullFile(file)
local f = assert(io.open(file, "rb"))
local content = f:read("*all")
f:close()
return content
end