PDA

View Full Version : Structured Lua Libraries (SLL)


Mex
10-26-2009, 03:58 PM
Structured Lua Libraries (SLL) consists of useful functions grouped together, to make scripting easier.

Files

Download version 1.01 (http://cid-6ce47caf48727b43.skydrive.live.com/self.aspx/.Publ ic/SLL/SLL%20Files%201.01.zip)
Download version 1.00 (http://cid-6ce47caf48727b43.skydrive.live.com/self.aspx/.Publ ic/SLL/SLL%20Files%201.00.zip)

-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Function syntaxes without data types ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Exists, Error = file.exists(FilePath) ~@
-- @~ ~@
-- @~ Data, Error = file.read(FilePath, [ LineNumber ]) ~@
-- @~ Lines, Error = file.lines(FilePath) ~@
-- @~ LineExists, Error = file.isline(FilePath, LineNumber/LineData) ~@
-- @~ ~@
-- @~ Success, Error = file.write(FilePath, Data, [ LineNumber ]) ~@
-- @~ Success, Error = file.clear(FilePath, [ LineNumber/LineData ]) ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@


Data Type Conversion

Download version 1.00 (http://cid-6ce47caf48727b43.skydrive.live.com/self.aspx/.Publ ic/SLL/SLL%20Data%20Type%20Conversion%201.00.zip)

-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~@
-- @~ Function syntaxes without data types ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~@
-- @~ Table, Error = convert.s2t(String, Seperator/Ascii) ~@
-- @~ Variable1, Variable2, Error = convert.s2v(String, Seperator/Ascii) ~@
-- @~ ~@
-- @~ String, Error = convert.t2s(Table, Seperator/Ascii) ~@
-- @~ Variable1, Variable2, Error = convert.t2v(Table) ~@
-- @~ ~@
-- @~ String, Error = convert.v2s(Value1, [ Value2 ], [ ... ], Seperator/Ascii) ~@
-- @~ Table, Error = convert.v2t(Value1, [ Value2 ], [ ... ]) ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~@


Tokens

Download version 1.00 (http://cid-6ce47caf48727b43.skydrive.live.com/self.aspx/.Publ ic/SLL/SLL%20Tokens%201.00.zip)

-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Function syntaxes without data types ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Amount, Error = token.amount(String, Asc/Chr) ~@
-- @~ Exists, Error = token.exists(String, N/Token, Asc/Chr) ~@
-- @~ ~@
-- @~ String, Error = token.add(String, Token, Asc/Chr) ~@
-- @~ String, Error = token.remove(String, N/Token, Asc/Chr) ~@
-- @~ String, Error = token.insert(String, N/Token, Token, Asc/Chr) ~@
-- @~ ~@
-- @~ N/Token, Error = token.get(String, N/Token, Asc/Chr) ~@
-- @~ N, Token, Error = token.getsub(String, SubToken, Asc/Chr) ~@
-- @~ ~@
-- @~ String, Error = token.replace(String, N/Token, Token, Asc/Chr) ~@
-- @~ ~@
-- @~ String, Error = token.swap(String, N/Token, N/Token, Asc/Chr) ~@
-- @~ String, Error = token.shift(String, N/Token, N/Token, Asc/Chr) ~@
-- @~ String, Error = token.sort(String, Ascending, Asc/Chr) ~@
-- @~ String, Error = token.reverse(String, Asc/Chr) ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@


Please report any bugs you find!

Mex
11-13-2009, 10:57 AM
Version 1.01 of SLL Files has been released!

Containing 1 bug fix:

Calling file.write() without a line number no longer adds a new line if the file is already blank


Check first post for the download link.

PlayerX
11-15-2009, 06:04 PM
nice mex :D...

tuntis
11-17-2009, 02:45 PM
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Function syntaxes without data types ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
-- @~ Exists, Error = file.exists(FilePath) ~@
-- @~ ~@
-- @~ Data, Error = file.read(FilePath, [ LineNumber ]) ~@
-- @~ Lines, Error = file.lines(FilePath) ~@
-- @~ LineExists, Error = file.isline(FilePath, LineNumber/LineData) ~@
-- @~ ~@
-- @~ Success, Error = file.write(FilePath, Data, [ LineNumber ]) ~@
-- @~ Success, Error = file.clear(FilePath, [ LineNumber/LineData ]) ~@
-- @~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~@
Exactly what is the point in abstracting the existing Lua filesystem I/O functionality to a new bunch of functions?

Mex
11-17-2009, 03:51 PM
It's purely to make scripting easier and quicker, for example:

if file.exists("filename.txt") then
-- code
end

vs.

local Handle = io.open("filename.txt")
if Handle then
io.close(Handle)
-- code
end