USYSTEM Function

Use the USYSTEM( ) function to obtain information from the underlying operating system environment, as opposed to the normal SYSTEM( ) function which returns information relating more to the mvBase or MultiValue environment. The USYSTEM( ) syntax functions similar to the traditional BASIC SYSTEM( ) function.

Format

RESULT = USYSTEM(X)

Parameter(s)

X

1,2,3,4…10,11,12 ... etc. This single parameter is mandatory and a positive integer.

Description

The mvBASIC 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

UOPEN and related file I/O UCOMMANDS are:

Interoperability.

0

Allowed.

1

Disallowed.

12

UEXECUTE is:

Interoperability.

0

Allowed.

1

Disallowed.

13

UMESSAGE is:

Interoperability.

0

Allowed.

1

Disallowed.

14

Use of CLIPBOARD is:

Interoperability.

0

Allowed.

1

Disallowed.

15

Access to the SHELL is:

Interoperability.

0

Allowed.

1

Disallowed.

21

Where is the Server which the user is connected to?

Server-related.

0

Connected to remote Server.

1

Connected to local Server.

22

Type of Operating System (O/S Platform code):

Server-related.

3

Windows NT.

23

Local system name (Workstation).

Other.

24

Path of client executable.

Client-related.

25

Windows user name used to login to Windows on the Server system.

Server-related.

26

Name of client (e.g. mvTerm).

Client-related.

27

Name of system running the Server.

Server-related.

28

Client ID of the client connected to the Line Number specified. See the section below this table for further information.

Client-related.

204

mvBase Server name and the specified Client ID is configured to connect to.

Client-related.

205

Line Number the specified Client ID is configured to connect to.

Client-related.

206

System where the mvBase Workstation is located.

Client-related.

USYSTEM 28

USYSTEM(28, Line#)

Retrieves the Client ID (name of client as entered in the Workstation_Name configuration) of the client connected to the Line Number specified. If the Line Number specified is not connected, the function returns the string not connected. If the Line Number specified is connected to an unidentified client (for example, mvTerm), the string invalid is returned.

USYSTEM 204

USYSTEM(204,"Workstation_Name":AM:"Client_ID")

Returns the mvBase Server name and the specified Client ID is configured to connect to:

Workstation_Name

Specifies the system where the mvBase Workstation is located. A NULL value means to use the system were the mvServer process is running.

Client_ID

Name of client as configured on the mvBase Workstation. The Client ID can be either a COM port or a Printer, searched for in that order.

A return value of -100 means the specified mvBase Workstation could not be found (does not exist or is unreachable).

A return value of -101 means the specified Client ID does not exist on the specified mvBase Workstation.

USYSTEM 205

USYSTEM(205,"Workstation_Name":AM:"Client_ID")

Returns the Line Number the specified Client ID is configured to connect to:

Workstation_Name

Specifies the system where the mvBase Workstation is located. A NULL value means to use the system were the mvServer process is running.

Client_ID

Name of client as configured on the mvBase Workstation. The Client ID can be either a COM port or a Printer, searched for in that order.

A return value of -100 means the specified mvBase Workstation could not be found (does not exist or is unreachable).

A return value of -101 means the specified Client ID does not exist on the specified mvBase Workstation.

USYSTEM 206

The new USYSTEM (206) function returns a formatted dynamic array containing the configuration information for a specified client on a specified mvWorkstation. This function has the following form:

USYSTEM(206,"Workstation_Name":AM:"Client_ID":AM:Client_Type:AM:Enum)

 

Workstation_Name

Specifies the system where the mvBase Workstation is located. A NULL value means to use the system were the mvServer process is running.

Client_ID

Name of client as configured on the mvBase Workstation. The Client ID can be either a COM port or a Printer, searched for in that order.

Client_Type

Specifies the client type requested. Possible values are:

1 = COM port

2 = Printer

3 = mvTelnet.

Enum

Initially set to 0. However, this function may require being called multiple times to retrieve all the configuration information. See Returns section for more information.

Returns

This function returns an output string in the form:

Enum:AM:Configuration_String

 

Enum

Indicates whether all the configuration strings have been retrieved, or an error. If the returned value is:

greater than 0

Indicates that additional configuration strings need to be retrieved. Call USYSTEM(206, …) again with this value.

1

Indicates that all configuration strings have been retrieved.

-100

Indicates that the mvBase Workstation could not be accessed (does not exist or is unreachable).

-101

Indicates that the specified Client ID does not exist on the specified mvBase Workstation.

Configuration_String

One or more attributes containing a Name:VM:Value pair, where Name is the name of the configuration value (Registry Value name).

Examples

Enum = 0; Config = ''

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

UCLOSE Command

UCREATE Command

UDELETE Command

UERROR Function

UEXECUTE Command

ULOCK Command

ULSEEK Function

UMESSAGE Command

UOPEN Command

UREAD Command

UREADLINE Function

UWAITFOR Command

UWRITE Command