Libraries.System.Properties Documentation

The properties class is designed to gather information about the system that the user is running. Currently, it supports a general property action, GetProperty, which can gather any known system property. It also currently contains helper methods for determining which operating system the user is on and for determining which web page was requested if this is a web project. System properties are equivalent to what are often termed "environment variables." The properties class does query the operating system for information, but does not contain any state itself.

Example Code

use Libraries.System.Properties

Properties properties
text address = properties:GetRequestedWebPage()
output address

Inherits from: Libraries.Language.Object

Variables Table

VariablesDescription
text requestedWebPageThis is a public constant for the web address environment variable, if one is set.
text javaRuntimeNameThis is a public constant for the java runtime name.
text iosSimulatorThis is a public property that is set to true if we are running on an ios simulator.
text operatingSystemThis is a public constant for the operating system property name.
text versionThis asks the system for the operating system version.

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetEnvironmentVariable(text key)

This action returns an environment variable from the system.

Parameters

  • text key: the property being requested

Return

text:

Example

use Libraries.System.Properties

Properties properties
text value = properties:GetEnvironmentVariable("quorum.url")
output value

GetEnvironmentVariables()

This action returns all environment variables on the system.

Return

Libraries.Containers.HashTable:

Example

use Libraries.System.Properties

Properties properties
HashTable<text, text> table = properties:GetEnvironmentVariables()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetOperatingSystemName()

This property returns the name of the operating system currently running the program.

Return

text:

Example

use Libraries.System.Properties

Properties properties
text value = properties:GetOperatingSystemName()
output value

GetOperatingSystemVersion()

This property returns the name of the operating system version currently running the program.

Return

text:

Example

use Libraries.System.Properties

Properties properties
text value = properties:GetOperatingSystemVersion()
output value

GetProperties()

This action returns all properties on the system.

Return

Libraries.Containers.HashTable:

Example

use Libraries.System.Properties

Properties properties
HashTable<text, text> table = properties:GetProperties()

GetProperty(text key)

This action returns a property from the system.

Parameters

  • text key: the property being requested

Return

text:

Example

use Libraries.System.Properties

Properties properties
text value = properties:GetProperty("os.name")
output value

GetRequestedWebPage()

This helper method returns the requested web address if the project was a web project.

Return

text:

Example

use Libraries.System.Properties

Properties properties
text address = properties:GetRequestedWebPage()
output address

GetRunLocation()

This action returns a the location of the running executable on the system.

Return

Libraries.System.File:

Example

use Libraries.System.Properties
use Libraries.System.File

Properties properties
File file = properties:GetRunPath()
output file:GetAbsolutePath()

IsAndroid()

This property returns whether or not the program is running on Android.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsAndroid()
output value

IsIos()

This property returns whether or not the program is running on Apple's ios, either the simulator or the device.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsIos()
output value

IsIosSimulator()

This property returns whether or not the program is running on Apple's ios simulator.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsIosSimulator()
output value

IsMac()

This property returns whether or not the program is running on Mac.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsMac()
output value

IsWebBrowser()

This property returns whether or not the program is running on a web browser.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsWebBrowser()
output value

IsWindows()

This property returns whether or not the program is running on Windows.

Return

boolean:

Example

use Libraries.System.Properties

Properties properties
boolean value = properties:IsWindows()
output value

SetProperty(text key, text value)

This action sets a property on the system.

Parameters

  • text key: the property being requested
  • text value: the property value being set

Example

use Libraries.System.Properties

Properties properties
properties:SetProperty("my.custom.property", "value")