All Bundles

Runtime

Provides access to runtime system

Operations

Assert

Asserts runtime value to be true. If false, program exits with stack trace.

function : Assert(assert:Bool) ~ Nil
Parameters
NameTypeDescription
assertBoolvalue to assert

Command

Executes a system command

function : Command(c:System.String) ~ Int
Parameters
NameTypeDescription
cStringsystem command

Return
TypeDescription
Intcommand status code

CommandOutput

Executes a system command

function : CommandOutput(c:System.String) ~ CommandOutput
Parameters
NameTypeDescription
cStringsystem command

Return
TypeDescription
CommandOutputoutput from command

Executes a system command

function : CommandOutput(c:System.String, e:String[]) ~ CommandOutput
Parameters
NameTypeDescription
cStringsystem command
eString[]array of environment variables

Return
TypeDescription
CommandOutputoutput from command

Copy

Copies data between two byte arrays

function : Copy(dest:Byte[], dest_offset:Int, src:Byte[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destByte[]destination array
dest_offsetIntdestination array copy offset
srcByte[]source array
src_offsetIntsource array copy offset
lenIntnumber of bytes to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Copies data between two character arrays

function : Copy(dest:Char[], dest_offset:Int, src:Char[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destChar[]destination array
dest_offsetIntdestination array copy offset
srcChar[]source array
src_offsetIntsource array copy offset
lenIntnumber of characters to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Copies data between two integer arrays

function : Copy(dest:Int[], dest_offset:Int, src:Int[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destInt[]destination array
dest_offsetIntdestination array copy offset
srcInt[]source array
src_offsetIntsource array copy offset
lenIntnumber of values to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Copies data between two Base arrays

function : Copy(dest:Base[], dest_offset:Int, src:Base[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destBase[]destination array
dest_offsetIntdestination array copy offset
srcBase[]source array
src_offsetIntsource array copy offset
lenIntnumber of values to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Copies data between two Compare arrays

function : Copy(dest:Compare[], dest_offset:Int, src:Compare[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destCompare[]destination array
dest_offsetIntdestination array copy offset
srcCompare[]source array
src_offsetIntsource array copy offset
lenIntnumber of values to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Copies data between two float arrays

function : Copy(dest:Float[], dest_offset:Int, src:Float[], src_offset:Int, len:Int) ~ Bool
Parameters
NameTypeDescription
destFloat[]destination array
dest_offsetIntdestination array copy offset
srcFloat[]source array
src_offsetIntsource array copy offset
lenIntnumber of values to copy

Return
TypeDescription
Booltrue if successful, false otherwise

Exit

Causes the executing program to halt

function : Exit(code:Int) ~ Nil
Parameters
NameTypeDescription
codeIntexit code

GetEnvironmentVariable

Fetches a runtime environment variable.

function : GetEnvironmentVariable(key:String) ~ String
Parameters
NameTypeDescription
keyStringvariable key

Return
TypeDescription
Stringruntime environment variable

GetInstallDir

Returns the installation directory

function : GetInstallDir() ~ String
Return
TypeDescription
Stringinstallation directory

GetPlatform

Returns an OS platform string

function : GetPlatform() ~ String
Return
TypeDescription
StringOS platform string

GetProperty

Fetches a runtime property. System properties include: 'user_dir', temp_dir and 'install_dir'.

function : GetProperty(key:String) ~ String
Parameters
NameTypeDescription
keyStringproperty key

Return
TypeDescription
Stringruntime property

GetTempDir

Returns the system's temporary directory

function : GetTempDir() ~ String
Return
TypeDescription
Stringsystem's temporary directory

GetTime

Returns the current time

function : GetTime(gmt:Bool) ~ Time.Date
Parameters
NameTypeDescription
gmtBooltrue of time is in GMT, false for system time zone

Return
TypeDescription
Datecurrent time

GetUserDir

Returns the current user's working directory

function : GetUserDir() ~ String
Return
TypeDescription
Stringcurrent user's working directory

GetVersion

Returns the package version string

function : GetVersion() ~ String
Return
TypeDescription
Stringpackage version string

HasEnvironmentVariable

Checks if an environment variable exists

function : HasEnvironmentVariable(key:String) ~ Bool
Parameters
NameTypeDescription
keyStringvariable key

Return
TypeDescription
Booltrue if it exists, false otherwise

HasProperty

Checks if a property exists

function : HasProperty(key:String) ~ Bool
Parameters
NameTypeDescription
keyStringproperty key

Return
TypeDescription
Booltrue if it exists, false otherwise

RaiseSignal

Raises a system signal

function : RaiseSignal(type:Runtime->Signal) ~ Nil
Parameters
NameTypeDescription
typeRuntime->Signalsignal type

SetEnvironmentVariable

Sets a runtime environment variable

function : SetEnvironmentVariable(key:String, value:String) ~ Nil
Parameters
NameTypeDescription
keyStringvariable key
valueStringenvironment value

SetLocale

Sets the runtime locale

function : SetLocale(locale:String) ~ Nil
Parameters
NameTypeDescription
localeStringlocale string

SetProperty

Sets a runtime property

function : SetProperty(key:String, value:String) ~ Nil
Parameters
NameTypeDescription
keyStringproperty key
valueStringproperty value

SetSignal

Sets a system signal

function : SetSignal(type:Runtime->Signal, func:(Int)~Nil) ~ Nil
Parameters
NameTypeDescription
typeRuntime->Signalsignal type
func(Int)~Nilfunction handler for signal