The System object contains properties related to local settings and operations.

This object contains only static methods and properties. You cannot create new instances of the System object.


Static properties:

Lib.Media.System.totalMemory

[static] [read-only] The amount of memory (in bytes) currently in use that has been directly allocated by application.

Lib.Media.System.totalMemoryNumber

[static] [read-only] The amount of memory (in bytes) currently in use that has been directly allocated by application.

Lib.Media.System.deviceID

get unique device identifier (if supported)

Lib.Media.System.exeName

executable file name (if supported)


Static methods:

Lib.Media.System.exit(code)

Terminate Lua Script execution and exit to Lua Studio designer

code - A value to pass to the operating system. Typically, if the process exits normally, the value is 0. (ignored)

Lib.Media.System.gc()

[static] Forces the Library garbage collection process.


Lib.Media.System.pauseForGCIfCollectionImminent(imminence)

[static] Advise the garbage collector that if the collector's imminence exceeds the function's imminence parameter then the collector should finish the incremental collection cycle. Only for library garbage collector.

imminence - (default = 0.75) - A number between 0 and 1, where 0 means less imminent and 1 means most imminent. Values less than 0 default to 0.25. Values greater than 1.0 default to 1.0. 

Lib.Media.System.systemName()

Return OS system name: windows, mac, ios, android, etc.


Lib.Media.System.getLocalIpAddress()

Return local IP address


Lib.Media.System.restart(code)

Restart Lua Script.

code - A value to pass to the operating system. Typically, if the process restarts as script only, the value is 0. (ignored)

Lib.Media.System.getUrl(request, target)

The same as request.launchBrowser(). It will open platform native browser.

request - URLRequest object

target - (ignored)


Examples:


--System

print(Lib.Media.System.deviceID)

print(Lib.Media.System.totalMemory)

print(Lib.Media.System.systemName())

print(Lib.Media.System.exeName)

print(Lib.Media.System.getLocalIpAddress())


--Lib garbage collector

Lib.Media.System.gc()

--Exit

Lib.Media.System.restart(0)

Lib.Media.System.exit(0) 


--Web

Lib.Media.System.getURL(Lib.Media.Net.URLRequest.new("https://www.wikipedia.org/"), "_blank")

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator