Runtime
Provides access to runtime system
Operations
- Assert
- Command
- CommandOutput
- Copy
- Exit
- GetEnvironmentVariable
- GetInstallDir
- GetPlatform
- GetProperty
- GetTempDir
- GetTime
- GetUserDir
- GetVersion
- HasEnvironmentVariable
- HasProperty
- RaiseSignal
- SetEnvironmentVariable
- SetLocale
- SetProperty
- SetSignal
Assert
Asserts runtime value to be true. If false, program exits with stack trace.
function : Assert(assert:Bool) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| assert | Bool | value to assert |
Command
Executes a system command
function : Command(c:System.String) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
Return
| Type | Description |
|---|---|
| Int | command status code |
CommandOutput
Executes a system command
function : CommandOutput(c:System.String) ~ CommandOutputParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
Return
| Type | Description |
|---|---|
| CommandOutput | output from command |
CommandOutput
Executes a system command
function : CommandOutput(c:System.String, e:String[]) ~ CommandOutputParameters
| Name | Type | Description |
|---|---|---|
| c | String | system command |
| e | String | array of environment variables |
Return
| Type | Description |
|---|---|
| CommandOutput | output from command |
Copy
Copies data between two byte arrays
function : Copy(dest:Byte[], dest_offset:Int, src:Byte[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Byte | destination array |
| dest_offset | Int | destination array copy offset |
| src | Byte | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of bytes to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy
Copies data between two character arrays
function : Copy(dest:Char[], dest_offset:Int, src:Char[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Char | destination array |
| dest_offset | Int | destination array copy offset |
| src | Char | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of characters to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy
Copies data between two integer arrays
function : Copy(dest:Int[], dest_offset:Int, src:Int[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Int | destination array |
| dest_offset | Int | destination array copy offset |
| src | Int | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy
Copies data between two Base arrays
function : Copy(dest:Base[], dest_offset:Int, src:Base[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Base | destination array |
| dest_offset | Int | destination array copy offset |
| src | Base | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy
Copies data between two Compare arrays
function : Copy(dest:Compare[], dest_offset:Int, src:Compare[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Compare | destination array |
| dest_offset | Int | destination array copy offset |
| src | Compare | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Copy
Copies data between two float arrays
function : Copy(dest:Float[], dest_offset:Int, src:Float[], src_offset:Int, len:Int) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| dest | Float | destination array |
| dest_offset | Int | destination array copy offset |
| src | Float | source array |
| src_offset | Int | source array copy offset |
| len | Int | number of values to copy |
Return
| Type | Description |
|---|---|
| Bool | true if successful, false otherwise |
Exit
Causes the executing program to halt
function : Exit(code:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | exit code |
GetEnvironmentVariable
Fetches a runtime environment variable.
function : GetEnvironmentVariable(key:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
Return
| Type | Description |
|---|---|
| String | runtime environment variable |
GetInstallDir
Returns the installation directory
function : GetInstallDir() ~ StringReturn
| Type | Description |
|---|---|
| String | installation directory |
GetPlatform
Returns an OS platform string
function : GetPlatform() ~ StringReturn
| Type | Description |
|---|---|
| String | OS platform string |
GetProperty
Fetches a runtime property. System properties include: 'user_dir', temp_dir and 'install_dir'.
function : GetProperty(key:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| key | String | property key |
Return
| Type | Description |
|---|---|
| String | runtime property |
GetTempDir
Returns the system's temporary directory
function : GetTempDir() ~ StringReturn
| Type | Description |
|---|---|
| String | system's temporary directory |
GetTime
Returns the current time
function : GetTime(gmt:Bool) ~ Time.DateParameters
| Name | Type | Description |
|---|---|---|
| gmt | Bool | true of time is in GMT, false for local time zone |
Return
| Type | Description |
|---|---|
| Time.Date | current time |
GetUserDir
Returns the current user's working directory
function : GetUserDir() ~ StringReturn
| Type | Description |
|---|---|
| String | current user's working directory |
GetVersion
Returns the package version string
function : GetVersion() ~ StringReturn
| Type | Description |
|---|---|
| String | package version string |
HasEnvironmentVariable
Checks if an environment variable exists
function : HasEnvironmentVariable(key:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
Return
| Type | Description |
|---|---|
| Bool | true if it exists, false otherwise |
HasProperty
Checks if a property exists
function : HasProperty(key:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| key | String | property key |
Return
| Type | Description |
|---|---|
| Bool | true if it exists, false otherwise |
RaiseSignal
Raises a system signal
function : RaiseSignal(type:Runtime->Signal) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| type | Runtime->Signal | signal type |
SetEnvironmentVariable
Sets a runtime environment variable
function : SetEnvironmentVariable(key:String, value:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| key | String | variable key |
| value | String | environment value |
SetLocale
Sets the runtime locale
function : SetLocale(locale:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| locale | String | locale string |