SystemHelper

Package: Libraries.System · Inherits from: Libraries.Language.Object

This class provides some basic system functions. What it returns is dependent on the implementation of the language.

Example Code

use Libraries.System.SystemHelper

SystemHelper help
output help:GetAvailableProcessors()

Actions

Exit(integer code)

Forces the program to exit with a status code. By convention, 0 means exited normally and any other code is not.

Parameters

  • code integer

GetAvailableProcessors()

This action returns the total number of processors available to the program.

Returns

integer: The number of processors currently available to this program.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:GetAvailableProcessors()

GetFreeMemory()

This action returns the amount of memory that is currently free on the system. How this is computed is implementation dependent.

Returns

number: The amount of free memory available.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:GetFreeMemory()

GetMaximumMemory()

This action returns the maximum amount of memory available on the system.

Returns

number: The maximum amount of memory available to the system.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:GetMaximumMemory()

GetThreadName()

This action returns the name of the thread being actively run on a per system basis.

Returns

text: The name of the thread.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:GetThreadName()

GetTotalMemory()

This action returns the total amount of memory currently on the system.

Returns

number: The total amount of memory allocated.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:GetTotalMemory()

OpenInDefaultTextEditor(Libraries.System.File file)

This action takes the file and opens it in the default text editor on the system, if one exists. If it cannot, it fails silently.

Parameters

RequestGarbageCollection()

This action asks the system to collect any garbage currently in memory. Whether the system honors the request depends on the implementation.

Example

use Libraries.System.SystemHelper

SystemHelper help
output help:RequestGarbageCollection()

Sleep(integer milliseconds)

This class provides some basic system functions. What it returns is dependent on the implementation of the language.

Parameters

  • milliseconds integer: Tells the system to pause for a set number of milliseconds.

Example

use Libraries.System.SystemHelper

SystemHelper help
help:Sleep(1000) //one second

Inherited Actions

3 actions from Libraries.Language.Object