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

Summary

Variable Summary Table

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

Actions Summary Table

ActionsDescription
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetEnvironmentVariable(text key)This action returns an environment variable from the system.
GetEnvironmentVariables()This action returns all environment variables on the system.
GetHashCode()This action gets the hash code for an object.
GetOperatingSystemName()This property returns the name of the operating system currently running the program.
GetOperatingSystemVersion()This property returns the name of the operating system version currently running the program.
GetProperties()This action returns all properties on the system.
GetProperty(text key)This action returns a property from the system.
GetRequestedWebPage()This helper method returns the requested web address if the project was a web project.
GetRunLocation()This action returns a the location of the running executable on the system.
IsAndroid()This property returns whether or not the program is running on Android.
IsIos()This property returns whether or not the program is running on Apple's ios, either the simulator or the device.
IsIosSimulator()This property returns whether or not the program is running on Apple's ios simulator.
IsMac()This property returns whether or not the program is running on Mac.
IsWebBrowser()This property returns whether or not the program is running on a web browser.
IsWindows()This property returns whether or not the program is running on Windows.
SetProperty(text key, text value)This action sets a property on the system.

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.

Example Code

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

Parameters

Return

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

Equals(Libraries.Language.Object object)

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

Example Code

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

Parameters

Return

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

GetEnvironmentVariable(text key)

This action returns an environment variable from the system.

Example Code

use Libraries.System.Properties

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

Parameters

Return

text:

GetEnvironmentVariables()

This action returns all environment variables on the system.

Example Code

use Libraries.System.Properties

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

Return

Libraries.Containers.HashTable:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetOperatingSystemName()

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

Example Code

use Libraries.System.Properties

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

Return

text:

GetOperatingSystemVersion()

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

Example Code

use Libraries.System.Properties

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

Return

text:

GetProperties()

This action returns all properties on the system.

Example Code

use Libraries.System.Properties

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

Return

Libraries.Containers.HashTable:

GetProperty(text key)

This action returns a property from the system.

Example Code

use Libraries.System.Properties

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

Parameters

Return

text:

GetRequestedWebPage()

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

Example Code

use Libraries.System.Properties

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

Return

text:

GetRunLocation()

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

Example Code

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

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

Return

Libraries.System.File:

IsAndroid()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

IsIos()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

IsIosSimulator()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

IsMac()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

IsWebBrowser()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

IsWindows()

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

Example Code

use Libraries.System.Properties

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

Return

boolean:

SetProperty(text key, text value)

This action sets a property on the system.

Example Code

use Libraries.System.Properties

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

Parameters