# usystem() function

The usystem() function is used to obtain information from the
 underlying operating system environment.

The typical SYSTEM( ) function returns information relating more to the multivalue
 environment. Theusystem() syntax function is similar to the traditional
 BASIC SYSTEM() function.

## Format

```
RESULT = USYSTEM(X)
```

## Parameters

| x | 1,2,3,4…10,11,12 ... and so on. This single parameter is mandatory and a positive integer. |
| --- | --- |

## Description

The usystem() function returns:

| Number (X) | Returned Value (RESULT) | Category | |
| --- | --- | --- | --- |
| 1 | Option Flags. Returned in hexadecimal. | Client related | |
| 2 | 0 | Client is not character only. | Client related |
| 1 | Client is character only. | | |
| 3 | 0 | Client is not setup as output only (terminal). | Client related |
| 1 | Client is output only (printer). | | |
| 4 | 0 | Server is not a service, it is an application. | Server related |
| 1 | Server is a service. | | |
| 10 | Client application type: | Client related | |
| 0 | Phantom process | | |
| 2 | COM port | | |
| 5 | mvTerm | | |
| 7 | Telnet | | |
| 11 | The uopen command and related file I/O ucommands are: | Interoperability | |
| 0 | Allowed | | |
| 1 | Disallowed | | |
| 12 | The uexecute command is: | Interoperability | |
| 0 | Allowed | | |
| 1 | Disallowed | | |
| 13 | The umessage command is: | Interoperability | |
| 0 | Allowed | | |
| 1 | Disallowed | | |
| 14 | The use of CLIPBOARD is: | Interoperability | |
| 0 | Allowed | | |
| 1 | Disallowed | | |
| 15 | Access to the SHELL is: | Interoperability | |
| 0 | Allowed | | |
| 1 | Disallowed | | |
| 21 | (The location of the Server) (Where is the Server) to which the user is connected: | Server related | |
| 0 | Connected to remote Server. | | |
| 1 | Connected to local Server. | | |
| 22 | The type of Operating System (O/S Platform code): | Server related | |
| 3 | Windows NT | | |
| 23 | The local system name (Workstation) | Other | |
| 24 | The path of the client executable | Client related | |
| 25 | The Windows user name used to log in to Windows on the Server system | Server related | |
| 26 | The name of the client (for example, mvTerm) | Client related | |
| 27 | The name of the system running the Server | Server related | |
| 28 | Client ID of the client connected to the specified Line Number. See the following section for further information. | Client related | |
| 204 | The mvBase Server name and the specified Client ID is configured to connect to | Client related | |
| 205 | The Line Number the specified Client ID is configured to connect to | Client related | |
| 206 | The System where the mvBase Workstation is located | Client related | |

 Note: Currently only 1-27, 100, and 201-203 are supported.

## Example(s)

```
Enum = 0; Config = &#39;&#39;
LOOP
 Temp=USYSTEM(206,WorkStation:@AM:ClientID:@AM:Type:@AM:Enum)
 FOR I = 2 TO DCOUNT(Temp,@AM)
 Config<-1> = Temp<I>
 NEXT I
 Enum = Temp<1>
WHILE Enum GT 0 DO REPEAT
```

## See also

- [O/S interoperability commands and functions](https://d3codex.com/pickbasic-flashbasic/os-interoperability-commands/)
- [uclose command](https://d3codex.com/pickbasic-flashbasic/uclose-command/)
- [ucreate command](https://d3codex.com/pickbasic-flashbasic/ucreate-command/)
- [udelete command](https://d3codex.com/pickbasic-flashbasic/udelete-command/)
- [uerror() function](https://d3codex.com/pickbasic-flashbasic/uerror-function/)
- [uexecute command](https://d3codex.com/pickbasic-flashbasic/uexecute-command/)
- [ulock command](https://d3codex.com/pickbasic-flashbasic/ulock-command/)
- [ulseek() function](https://d3codex.com/pickbasic-flashbasic/ulseek-function/)
- [umessage command](https://d3codex.com/pickbasic-flashbasic/umessage-command/)
- [uopen command](https://d3codex.com/pickbasic-flashbasic/uopen-command/)
- [uread command](https://d3codex.com/pickbasic-flashbasic/uread-command/)
- [ureadline() function](https://d3codex.com/pickbasic-flashbasic/ureadline-function/)
- [uwaitfor command](https://d3codex.com/pickbasic-flashbasic/uwaitfor-command/)
- [uwrite command](https://d3codex.com/pickbasic-flashbasic/uwrite-command/)

---
Source: https://d3codex.com/pickbasic-flashbasic/usystem-function/ - part of the D3Codex reference.
