Lib system objects:



including few system functions:


Lib.Sys.getStamp()

Returns a timestamp, in seconds with fractions (float).
The value itself might differ depending on platforms, only differences between two values make sense.


Lib.Sys.getTime()

Returns a timestamp, in milliseconds (int).


Lib.Sys.trace(message)

Print Lib system trace message in console. 2000 characters limit or truncated. For Lib objects or converted lua objects will use toString() method if available. Returns not truncated trace message.

message - trace message text or object with toString()

Lib.Sys.throw(error)

Throw Lib error. Current Lib binding implementation can't capture library errors using pcall function. Use callMethodSafe from Lib.Reflect for this.

REMOVED FROM LIB (use error())

error - error message string

Lib.Sys.sleep(seconds)

Suspend the current execution for the given time (in seconds)

seconds - time (in seconds)


read-only properties:

Lib.Sys.version

prints current Lua Studio version


Examples:


print("Lua Studio version: "..Lib.Sys.version)


local table = {a=5, v=8}

print(table) -- print something like: table: 067B9AA0

Lib.Sys.trace(table) -- print: { a => 5, v => 8 }


sys1 = Lib.Sys

sys2 = Lib.Sys

print(sys1 == sys2) -- result true

print(Lib.Sys.sleep == Lib.Sys.sleep) -- result false (Lib methods uncomparable)


print(Lib.Sys.getTime()) -- get current time in milliseconds since January 1, 1970 (midnight)

Lib.Sys.sleep(10) -- sleep for 10 seconds


Lib.Sys.throw("My Error")


Lib.Reflect.callMethodSafe(Lib.Sys, "throw", {"My Error"}, function(err) print("ERROR: "..err) end)

Created with the Personal Edition of HelpNDoc: Easy EBook and documentation generator