Module

# System

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

The properties of the <span class="title-ref">System</span> module are used to get information about the computer running the application.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                  | Type                                                   | Read-Only | Shared |
|-------------------------------------------------------|--------------------------------------------------------|-----------|--------|
| `CommandLine<system.commandline>`                     | `String</api/data_types/string>`                       | ✓         |        |
| `Cursors<system.cursors>`                             | `MouseCursor</api/user_interface/desktop/mousecursor>` | ✓         |        |
| `Keychain<system.keychain>`                           | `Keychain</api/macos/keychain>`                        | ✓         |        |
| `KeychainCount<system.keychaincount>`                 | `Integer</api/data_types/integer>`                     | ✓         |        |
| `LastFontIndex<system.lastfontindex>`                 | `Integer</api/data_types/integer>`                     | ✓         |        |
| `MouseDown<system.mousedown>`                         | `Boolean</api/data_types/boolean>`                     | ✓         |        |
| `MouseX<system.mousex>`                               | `Integer</api/data_types/integer>`                     | ✓         |        |
| `MouseY<system.mousey>`                               | `Integer</api/data_types/integer>`                     | ✓         |        |
| `Network<system.network>`                             | `Network</api/networking/network>`                     | ✓         |        |
| `NetworkInterfaceCount<system.networkinterfacecount>` | `Integer</api/data_types/integer>`                     | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                              | Parameters                                                                                                                      | Returns                                              | Shared |
|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|--------|
| `Beep<system.beep>`                               |                                                                                                                                 |                                                      |        |
| `CoreCount<system.corecount>`                     |                                                                                                                                 | `Integer</api/data_types/integer>`                   |        |
| `DebugLog<system.debuglog>`                       | msg As `String</api/data_types/string>`                                                                                         |                                                      |        |
| `Device<system.device>`                           |                                                                                                                                 | `System.DeviceData</api/mobile/system.devicedata>`   |        |
| `DismissKeyboard<system.dismisskeyboard>`         |                                                                                                                                 |                                                      |        |
| `EnvironmentVariable<system.environmentvariable>` | Name As `String</api/data_types/string>`                                                                                        | `String</api/data_types/string>`                     |        |
|                                                   | Name As `String</api/data_types/string>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>`            |                                                      |        |
| `FontAt<system.fontat>`                           | index As `Integer</api/data_types/integer>`                                                                                     | `String</api/data_types/string>`                     |        |
| `FontCount<system.fontcount>`                     |                                                                                                                                 | `Integer</api/data_types/integer>`                   |        |
| `GotoMap<system.gotomap>`                         | address As `String</api/data_types/string>`                                                                                     |                                                      |        |
| `GotoURL<system.gotourl>`                         | URL As `String</api/data_types/string>`                                                                                         |                                                      |        |
| `IsFunctionAvailable<system.isfunctionavailable>` | FunctionName As `String</api/data_types/string>`, LibraryName As `String</api/data_types/string>`                               | `Boolean</api/data_types/boolean>`                   |        |
| `Log<system.log>`                                 | level As `Integer</api/data_types/integer>`, msg As `String</api/data_types/string>`                                            |                                                      |        |
| `Microseconds<system.microseconds>`               |                                                                                                                                 | `Double</api/data_types/double>`                     |        |
| `NetworkInterface<system.networkinterface>`       | index As `Integer</api/data_types/integer>` = -1                                                                                | `NetworkInterface</api/networking/networkinterface>` |        |
| `Random<system.random>`                           |                                                                                                                                 | `Random</api/math/random>`                           |        |
| `Speak<system.speak>`                             | phrase As `String</api/data_types/string>`, allowInterrupt As `Boolean</api/data_types/boolean>` = `False</api/language/false>` |                                                      |        |
| `Ticks<system.ticks>`                             |                                                                                                                                 | `Integer</api/data_types/integer>`                   |        |
| `Version<system.version>`                         |                                                                                                                                 | `System.VersionData</api/os/system.versiondata>`     |        |

## Property descriptions

<div id="system.commandline">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.CommandLine

**CommandLine** As `String</api/data_types/string>`

> This property contains the parameters passed to the application.
>
> This property is read-only.
>
> For example, if the application "Foo.exe" was executed with the call "Foo.exe a b c", then <span class="title-ref">CommandLine</span> would contain "Foo.exe a b c". This is valid for Windows, macOS, and Linux applications.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not supported for Mobile projects.
>
> </div>

<div id="system.cursors">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Cursors

**Cursors** As `MouseCursor</api/user_interface/desktop/mousecursor>`

> Provides access to the cursors in the `Cursors</api/user_interface/desktop/cursors>` module.
>
> This property is read-only.
>
> Use these cursors to change the current mouse pointer to any of the standard cursor shapes.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Cursors is only supported for Desktop projects.
>
> </div>
>
> The following line in the MouseDown event of a `Canvas</api/user_interface/desktop/desktopcanvas>` changes the cursor to the HandOpen cursor. Returning `True</api/language/true>` allows the MouseUp event to be called.
>
> ``` xojo
> Me.MouseCursor = System.Cursors.HandOpen
> Return True
> ```

<div id="system.keychain">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Keychain

**Keychain** As `Keychain</api/macos/keychain>`

> Returns the default `Keychain</api/macos/keychain>`.
>
> This property is read-only.
>
> You can assign the default `Keychain</api/macos/keychain>` by setting this to another `Keychain</api/macos/keychain>`. If no `Keychain</api/macos/keychain>` exists, it will try to create one. If you don't want it to create one, you should first call <span class="title-ref">System</span>.KeyChainCount and check against 0.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Keychain is only supported for Desktop projects on macOS.
>
> </div>
>
> The following example adds a `KeychainItem</api/macos/keychainitem>` for an application and assigns a password.
>
> ``` xojo
> Var newItem As KeychainItem
>
> If System.KeychainCount > 0 Then
>   newItem = New KeychainItem
>   ' Indicate the name of the application
>   newItem.ServiceName = "MyApplication"
>
>   ' Create a new keychain item for the application and assign the password
>   System.Keychain.AddPassword(newItem, "SecretPassword")
> Else
>   System.Beep
>   MessageBox("You don't have a key chain.")
> End If
>
> Exception e As KeychainException
>   MessageBox("Can't add item: " + e.Message)
> ```

<div id="system.keychaincount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.KeychainCount

**KeychainCount** As `Integer</api/data_types/integer>`

> Returns the number of available `Keychains</api/macos/keychain>`.
>
> This property is read-only.
>
> This number includes all `Keychains</api/macos/keychain>` within the Keychains folder as well as any other `Keychains</api/macos/keychain>` known to the `Keychain's</api/macos/keychain>` manager.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> KeychainCount is only supported for Desktop projects on macOS.
>
> </div>
>
> The following example adds a `KeychainItem</api/macos/keychainitem>` for an application and assigns a password. It first checks to make sure that there are some keychain items.
>
> ``` xojo
> Var newItem As KeychainItem
>
> If System.KeychainCount > 0 Then
>   newItem = New KeychainItem
>   ' Indicate the name of the application
>   newItem.ServiceName = "MyApplication"
>
>   ' Create a new keychain item for the application and assign the password
>   System.KeyChain.AddPassword(newItem, "SecretPassword")
> Else
>   System.Beep
>   MessageBox("You don't have a key chain.")
> End If
>
> Exception e As KeychainException
>   MessageBox("Can't add item: " + e.Message)
> ```

<div id="system.lastfontindex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.LastFontIndex

**LastFontIndex** As `Integer</api/data_types/integer>`

> The index number of the last font installed on the user's computer.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not currently supported for Android.
>
> </div>
>
> This example populates a top-level menu called *FontMenu* with the names of the installed fonts:
>
> ``` xojo
> For i As Integer = 0 To System.LastFontIndex
>   FontMenu.AddMenu(New DesktopMenuItem(System.FontAt(i)))
> Next
> ```

<div id="system.mousedown">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.MouseDown

**MouseDown** As `Boolean</api/data_types/boolean>`

> `True</api/language/true>` if the mouse button has been pressed.
>
> This property is read-only.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `MouseDown` is supported for Desktop projects only.
>
> </div>

<div id="system.mousex">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.MouseX

**MouseX** As `Integer</api/data_types/integer>`

> The X coordinate of the mouse (points). Measured from the top-left corner of the screen.
>
> This property is read-only.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `MouseX` is supported for Desktop projects only.
>
> </div>
>
> This example gives the X and Y coordinates of the mouse when an event fires. For example, it works in a MouseDown or MouseEnter control event handler.
>
> ``` xojo
> MessageBox("X=" + System.MouseX.ToString + " Y=" + System.MouseY.ToString)
> ```

<div id="system.mousey">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.MouseY

**MouseY** As `Integer</api/data_types/integer>`

> The Y coordinate of the mouse (points). Measured from the top-left corner of the screen.
>
> This property is read-only.
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `MouseY` is supported for Desktop projects only.
>
> </div>
>
> This example gives the X and Y coordinates of the mouse when an event fires. For example, it works in a MouseDown or MouseEnter control event handler.
>
> ``` xojo
> MessageBox("X=" + System.MouseX.ToString + " Y=" + System.MouseY.ToString)
> ```

<div id="system.network">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Network

**Network** As `Network</api/networking/network>`

> Provides access to the methods of the `Network</api/networking/network>` module. They enable you to verify whether the computer is connected to a network and, if so, to look up DNS and IP addresses.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not supported for mobile projects.
>
> </div>
>
> The following call returns the IP address for the wikipedia.org domain name.
>
> ``` xojo
> Var ipAddress As String = System.Network.LookupIPAddress("wikipedia.org")
>
> If Not ipAddress.IsEmpty Then
>   MessageBox(ipAddress)
> Else
>   MessageBox("An error occurred.")
> End If
> ```

<div id="system.networkinterfacecount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.NetworkInterfaceCount

**NetworkInterfaceCount** As `Integer</api/data_types/integer>`

> Returns the count of `NetworkInterfaces</api/networking/networkinterface>` on the computer that are actually connected to a network.
>
> This property is read-only.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This property is not supported for mobile projects.
>
> </div>
>
> This example lists the IP addresses of the network interfaces on the computer:
>
> ``` xojo
> Var count As Integer = System.NetworkInterfaceCount
>
> For i As Integer = 0 To count - 1
>   Listbox1.AddRow(System.NetworkInterface(i).IPAddress)
> Next
> ```

## Method descriptions

<div id="system.beep">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Beep

**Beep**

> Plays the default <span class="title-ref">System</span> alert sound.
>
> The Beep method plays the default Beep sound selected on your computer.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported for Mobile and Web projects.
>
> </div>
>
> This code beeps if an error occurs:
>
> ``` xojo
> Var isError As Boolean = True
>
> If isError Then
>   System.Beep
> End If
> ```

<div id="system.corecount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.CoreCount

**CoreCount** As `Integer</api/data_types/integer>`

> Returns the total number of [logical cores](https://techgearoid.com/articles/difference-between-physical-cores-and-logical-processors/) the CPU has.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not currently supported for Android.
>
> </div>

<div id="system.debuglog">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.DebugLog

**DebugLog**(msg As `String</api/data_types/string>`)

> Outputs msg to the <span class="title-ref">System</span> debug log.
>
> On Windows, it logs to the debugger, so programs like DebugView can be used to view the string. On macOS, it logs to the Console. On Linux, it prints the message to StdErr.
>
> You can also view DebugLog output using the Messages panel in Xojo which is displayed by clicking the Messages icon at the bottom of the Xojo workspace window.

<div id="system.device">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Device

**Device** As `System.DeviceData</api/mobile/system.devicedata>`

> Returns a `System.DeviceData</api/mobile/system.devicedata>` object (singleton) that provides information about the device such as battery level, orientation, model name, etc.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is only supported for mobile projects.
>
> </div>
>
> This example displays the device's model name:
>
> ``` xojo
> MessageBox(System.Device.Model)
> ```

<div id="system.dismisskeyboard">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.DismissKeyboard

**DismissKeyboard**

> Hides the on-screen keyboard.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is only supported for Android.
>
> </div>

<div id="system.environmentvariable">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.EnvironmentVariable

**EnvironmentVariable**(Name As `String</api/data_types/string>`) As `String</api/data_types/string>`

**EnvironmentVariable**(Name As `String</api/data_types/string>`, `Assigns</api/language/assigns>` value As `String</api/data_types/string>`)

> Used to get and set environment variables. *Name* is case-sensitive.
>
> For web applications, you can use this method to get the "ROOT" or "DOCUMENT_ROOT" environment variables used by the web server. The "env" example below can be used to list all the available environment variables on your web server.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported for mobile projects.
>
> </div>
>
> Get the value of the HOME environment variable:
>
> ``` xojo
> Var s As String = System.EnvironmentVariable("HOME") 
>
> MessageBox(s)
> ```
>
> Set the value of the HOME environment variable:
>
> ``` xojo
> System.EnvironmentVariable("HOME") = "/Users/*username*"
> ```
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Some environment variables, such as `PWD`, are managed by the operating system and cannot be reliably set using this method. Attempting to set them may have no effect or produce unexpected results.
>
> </div>
>
> To set the working directory for commands executed via the `Shell</api/os/shell>` class, prefix the command with `cd` rather than trying to set `PWD`:
>
> ``` xojo
> Var sh As New Shell
> #If TargetWindows Then
>   sh.Execute("cd C:\Users\username\Documents && dir")
> #Else
>   sh.Execute("cd /Users/username/Documents && ls")
> #EndIf
> TextArea1.Text = sh.Result
> ```
>
> To get the list of environment variables and their values (macOS and Linux), execute the "env" command from a terminal window or via the `Shell</api/os/shell>` class. On Windows, use the "set" command instead of "env".
>
> ``` xojo
> Var sh As New Shell
> Var cmd As String
>
> #If TargetWindows Then
>   cmd = "set"
> #Else
>   cmd = "env"
> #EndIf
>
> sh.Execute(cmd)
> TextArea1.Text = sh.Result
> ```
>
> This example gets the value of the COMPUTERNAME environment variable on Windows.
>
> ``` xojo
> #If TargetWindows Then
>   TextField1.Text = System.EnvironmentVariable("COMPUTERNAME")
> #EndIf
> ```
>
> <div class="seealso">
>
> `Shell</api/os/shell>`
>
> </div>

<div id="system.fontat">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.FontAt

<div class="rst-class">

forsearch

</div>

Font

**FontAt**(index As `Integer</api/data_types/integer>`) As `String</api/data_types/string>`

> Used to access the names the installed fonts.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not currently supported for Android.
>
> </div>
>
> This is a function that determines if the font named passed is installed on the user's computer:
>
> ``` xojo
> Function FontAvailable(FontName As String) As Boolean
>   For i As Integer = 0 To System.LastFontIndex
>     If System.FontAt(i) = FontName Then
>       Return True
>     End If
>   Next
>   Return False
> End Function
> ```

<div id="system.fontcount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.FontCount

<div class="rst-class">

forsearch

</div>

Font

**FontCount** As `Integer</api/data_types/integer>`

> Used to determine the number of fonts installed on the user's computer.
>
> FontCount is useful when you need to build a list of available fonts or need to determine if a specific font is installed.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not currently supported for Android.
>
> </div>
>
> This example populates a top-level menu called *FontMenu* with the names of the installed fonts:
>
> ``` xojo
> For i As Integer = 0 To System.FontCount - 1
>   FontMenu.AddMenu(New DesktopMenuItem(System.FontAt(i)))
> Next
> ```

<div id="system.gotomap">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.GotoMap

**GotoMap**(address As `String</api/data_types/string>`)

> Launches Google Maps passing it the *address* passed.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is only supported for Android.
>
> </div>

<div id="system.gotourl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.GotoURL

**GotoURL**(URL As `String</api/data_types/string>`)

> Uses the appropriate web browser application (based on the user's Internet settings) to go to the HTTP URL specified.
>
> Displays the supplied URL in the user's default web browser. If the browser is not open, it will launch the browser. Whether the URL opens in a new tab or a new window is controlled by the user's browser settings.
>
> GotoURL is not global in a web app so you need to use `WebControl<webcontrol.gotourl>` instead.
>
> A [URL](http://en.wikipedia.org/wiki/Url) is an address for Internet locations such as web sites, FTP and email addresses.
>
> When used in a web app, if a web URL is passed, the current page is replaced with the page at the URL passed.
>
> Some web browsers have a limit on the length of a URL. These are common prefixes:
>
> | URL Prefix | Type                   | Notes                                                                     |
> |------------|------------------------|---------------------------------------------------------------------------|
> | <http://>  | web site               | Displays in the default web browser.                                      |
> | mailto:    | email                  | Opens the default email client with the supplied email address filled in. |
> | <ftp://>   | file transfer protocol | Opens the default FTP application to download the specified file.         |
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not currently supported for Console.
>
> </div>
>
> This desktop code launches the user's chosen web browser and go to the Xojo web page.
>
> ``` xojo
> System.GotoURL("http://www.xojo.com")
> ```
>
> This desktop code launches the user's chosen FTP client application and go to an FTP site.
>
> ``` xojo
> System.GotoURL("ftp://ftp.mysite.com/uploads")
> ```
>
> This desktop code launches the user's chosen email application and create a new email message, with the specified email address in the "To" area.
>
> ``` xojo
> System.GotoURL("mailto:diana@themyscira.org")
> ```
>
> If the URL to a file is transferred, <span class="title-ref">GotoURL</span> attempts to open this file in the corresponding program.
>
> This desktop code opens a PDF file:
>
> ``` xojo
> #If TargetDesktop
>   ' important to use FolderItem.URLPath
>   System.GotoURL(SpecialFolder.Desktop.Child("Invoice.pdf").URLPath)
> #EndIf
> ```

<div id="system.isfunctionavailable">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.IsFunctionAvailable

**IsFunctionAvailable**(FunctionName As `String</api/data_types/string>`, LibraryName As `String</api/data_types/string>`) As `Boolean</api/data_types/boolean>`

> IsFunctionAvailable will attempt to load the passed function from the specified library.
>
> If the function can be loaded, IsFunctionAvailable returns `True</api/language/true>`. If the operation fails, it returns `False</api/language/false>`. Calling IsFunctionAvailable or using the Soft keyword in a `Declare</api/language/declare>` statement will cache both the library loading code as well as the function itself. Multiple calls to the same function will suffer almost no overhead costs in comparison to regular ("hard") Declares. See the description of Soft Declares in the notes for the `Declare</api/language/declare>` statement.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported for mobile projects.
>
> </div>

<div id="system.log">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Log

**Log**(level As `Integer</api/data_types/integer>`, msg As `String</api/data_types/string>`)

> Writes *msg* to the logging mechanism.
>
> On macOS and Linux, it writes to the <span class="title-ref">System</span> logger, which is typically at /var/log. On Windows it writes to the Event Logger, which can be viewed by the Event Viewer.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported for Mobile projects.
>
> </div>
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> On macOS, the following levels do not appear in the log: debug, information, and success. This is an macOS issue.
>
> </div>
>
> For debugging purposes, use `System.DebugLog<system.debuglog>` instead.
>
> Use the following class constants when setting the value of the *level* parameter in calls to the Log method.
>
> | Constant            |
> |---------------------|
> | LogLevelAlert       |
> | LogLevelCritical    |
> | LogLevelDebug       |
> | LogLevelEmergency   |
> | LogLevelError       |
> | LogLevelInformation |
> | LogLevelNotice      |
> | LogLevelSuccess     |
> | LogLevelWarning     |
>
> For the following example writes your error message with the LogLevelError constant.
>
> ``` xojo
> System.Log(System.LogLevelError, "my Error message")
> ```

<div id="system.microseconds">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Microseconds

**Microseconds** As `Double</api/data_types/double>`

> Returns the number of microseconds (1,000,000th of a second) that have passed since the user's device was started.
>
> This code displays in message box the number of minutes the device has been on:
>
> ``` xojo
> Var minutes As Integer = System.Microseconds / 1000000 / 60
>
> MessageBox("Your device has been on for " + minutes.ToString + " minutes.")
> ```

<div id="system.networkinterface">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.NetworkInterface

**NetworkInterface**(index As `Integer</api/data_types/integer>` = -1) As `NetworkInterface</api/networking/networkinterface>`

> Use the `NetworkInterface</api/networking/networkinterface>` object to obtain networking information about the user's computer.
>
> Use the optional parameter to specify the network interface card. If *Index* is out of bounds, an `OutOfBoundsException</api/exceptions/outofboundsexception>` is raised. NetworkInterfaceCount gives you the number of network interfaces in the computer.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is not supported for mobile projects.
>
> </div>
>
> The following simple example displays the IP address, Subnet mask, and Mac address for the selected network interface. At start-up, the application detects all the network interfaces installed on the user's computer and loads them into a `PopupMenu</api/user_interface/desktop/desktoppopupmenu>`. The user then selects the desired network interface and the values are displayed in `TextFields</api/user_interface/desktop/desktoptextfield>`.
>
> The `PopupMenu's</api/user_interface/desktop/desktoppopupmenu>` Opening event handler is:
>
> ``` xojo
> For i As Integer = 0 To System.NetworkInterfaceCount - 1
>   PopupMenu1.AddRow(i.ToString)
> Next
> ```
>
> The SelectionChanged event handler for the `PopupMenu</api/user_interface/desktop/desktoppopupmenu>` is this:
>
> ``` xojo
> Sub SelectionChanged()
>   If Me.SelectedRowIndex > -1 Then
>     ' Get the NetworkInterface object for the selected item
>     Var iface As NetworkInterface = System.NetworkInterface(Me.SelectedRowIndex)
>
>     MacAddressField.Text = iface.MACAddress
>     IPAddressField.Text = iface.IPAddress
>     SubnetMaskField.Text = iface.SubnetMask
>   End If
> End Sub
> ```

<div id="system.random">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Random

**Random** As `Random</api/math/random>`

> Returns the singleton instance of the `Random</api/math/random>` class for generating random numbers.

<div id="system.speak">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Speak

**Speak**(phrase As `String</api/data_types/string>`, allowInterrupt As `Boolean</api/data_types/boolean>` = `False</api/language/false>`)

> Uses the built-in speech synthesizer to pronounce the passed text string.
>
> Speak takes a string (or any variant that can be expressed as a string) and uses the Windows or macOS text-to-speech engine to speak the text. The speech is asynchronous, allowing normal program flow to continue. By default, subsequent calls to Speak before the first call has finished will queue up and speak after the completion of the previous call. If the optional *allowInterrupt* flag is used and set to `True</api/language/true>`, the previous Speak calls will be stopped immediately.
>
> On Linux, Speak uses the [eSpeak](http://espeak.sourceforge.net/) library which is installed by default on Ubuntu 10.04 and newer.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This method is only supported for Desktop and Mobile projects. The `allowInterrupt` parameter is not supported for Android and iOS.
>
> </div>
>
> The following code in a `DesktopButton</api/user_interface/desktop/desktopbutton>` pronounces the phrase entered into a `DesktopTextField</api/user_interface/desktop/desktoptextfield>`.
>
> ``` xojo
> If Not TextField1.Text.IsEmpty Then
>   System.Speak(TextField1.Text)
> Else
>   System.Speak("Please enter some text in the field!")
> End If
> ```

<div id="system.ticks">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Ticks

**Ticks** As `Integer</api/data_types/integer>`

> Returns the length of time in ticks (60th of a second) that the device has been running since it was last booted. Note that this **does not** include time while the device is asleep.
>
> Because modern operating systems can stay running for a very long time, it's possible for the device's internal counter to reach its maximum value and then return to zero to begin counting again. This means that if you are using this function to determine how much time has elapsed between two events, you may encounter a case where it appears that the stop time is prior to the start time.
>
> This code displays in message box the number of minutes the device has been on.
>
> ``` xojo
> Var minutes As Integer = System.Ticks / 60 / 60
>
> MessageBox("Your device has been on for " + minutes.ToString + " minutes.")
> ```

<div id="system.version">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

System.Version

**Version** As `System.VersionData</api/os/system.versiondata>`

> Information about the current OS <span class="title-ref">System</span> version.
>
> - Can compare against text numbers formatted as "Major.Minor.Patch".
>
> ``` xojo
> If System.Version >= "10.14.1" Then
> ```
>
> - Automatically adds "0" to any missing segments. "14" is changed to "14.0.0" before the comparison is done.
> - Use `System.VersionData</api/os/system.versiondata>` to display the OS version.

## Notes

MouseX and MouseY return coordinates with respect to the top-left corner of the user's monitor. The `DesktopWindow</api/user_interface/desktop/desktopwindow>` class contains MouseX and MouseY properties that are referenced to the window.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Multiple interface support

Multiple network interface support enables you to write applications that can bind to different NIC cards installed on a user's machine. For example, you can use this to write tunneling applications. To see what interfaces are installed on the user's machine, you can use the `NetworkInterface<system.networkinterface>` method and assign the obtained interface object to a `NetworkInterface</api/networking/networkinterface>` property of the `SocketCore</api/networking/socketcore>` class.

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`DesktopApplication</api/user_interface/desktop/desktopapplication>`, `MouseCursor</api/user_interface/desktop/mousecursor>`; `App</api/language/app>`, `Cursors</api/user_interface/desktop/cursors>`, `NetworkInterface</api/networking/networkinterface>` objects.

</div>
