SYSTEM and REAL.SYSTEM Functions
SYSTEM function
The operation of the SYSTEM function depends on the MultiValue mode, selected with the $OPTIONS statement. The available elements are listed in the sections below; for elements that are not available or are not listed, and for all elements in unlisted modes, a runtime error occurs and the function returns 0.
Note
When in one of the MultiValue modes, the ASSIGN and SYSTEM statements can only change the values of the settable elements that are available in that mode.
REAL.SYSTEM function
The REAL.SYSTEM function always behaves like the SYSTEM function with Reality mode selected, regardless of the actual MultiValue mode selected. This function is used within Reality internal programs but is available for use within user programs that want to use all features available in the Reality environment regardless of the MultiValue mode selected.
For example, REAL.SYSTEM(21) will always return the type of visual characteristics supported by the current TERMTYPE (for Reality), but SYSTEM(21) will return either the number of the port on which the current process is running (for mvEnterprise), the user's system privilege level (for mvBase), the current date (for D3), or False (for Universe), depending on the MultiValue mode.
Operation
Select the emulation you require from the drop down list below:
mvEnterprise
In mvEnterprise mode, the SYSTEM function supports the following system elements.
Element |
Return Value |
Reality Equivalent |
---|---|---|
0 |
Returns one of the following:
|
0 |
1 |
Returns 1 if the current PRINT statement destination is the printer; otherwise 0. |
1 |
2 |
The current page width as set using the TERM command. |
2 |
3 |
The current page length as set using the TERM command. |
3 |
4 |
The number of lines remaining to print on the current page, based on the parameters defined by the last TERM command (if a HEADING statement has been used). |
4 |
5 |
The current page number (if a HEADING statement has been used). |
5 |
6 |
The current line count (if a HEADING statement has been used). |
6 |
7 |
The terminal type as set using by the TERM command. |
7 |
8 |
Not currently available. |
96 |
9 |
The CPU usage for this process in milliseconds. |
9 |
10 |
Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
10 |
11 |
If an external list is currently active, returns the number of items in the list ; otherwise, returns 0. The list must have been generated by a list-generating command executed immediately prior to running the current program. |
- |
12 |
The current system time as the number of milliseconds since midnight. |
55 |
13 |
Sleeps for 100ms and then returns 1. |
- |
Returns 1 if typeahead data is present; otherwise 0. |
14 |
|
15 |
A dynamic array containing the options specified as part of the last TCL statement, as follows: Attribute 1 A string of letters corresponding to the alpha options typed. Attribute 2 The first numeric parameter. Attribute 3 The second numeric parameter. Attributes 2 and 3 are present only if the corresponding numeric parameters were specified at TCL. |
15 |
16 |
The current level of PERFORM statement. PERFORMs can be nested 32 levels deep. |
16 |
17 |
The user's system privilege: if SYS2, returns 1; otherwise 0. |
- |
18 |
The number of physical ports. |
93 |
19 |
Returns a unique identifier based on the date and time, with a suffix to make this unique if necessary. |
94 |
20 |
Returns the print job-id of the last spooler entry created by this process. The print job-id consists of the spooler job-name (as specified using SP-ASSIGN) followed by the job number. If there is no spooler entry, returns null. |
103 |
21 |
The number of the port on which the current process is running. |
18 |
22-35 |
Not used. |
- |
36 |
If the current program is a subroutine, the name of the routine that called it. |
79 |
37-99 |
Not used. |
- |
100 |
Not currently available |
- |
101 |
The maximum available port number. |
92 |
102+ |
Not used. |
- |
mvBase
In mvBase mode, the SYSTEM function supports the following system elements.
Element |
Return Value |
Reality Equivalent |
---|---|---|
0 |
Not currently available. |
- |
1 |
Returns 1 if the current PRINT statementdestination is the printer; otherwise 0. |
1 |
2 |
The current page width as set using the TERM command. |
2 |
3 |
The current page length as set using the TERM command. |
3 |
4 |
The number of lines remaining to print on the current page, based on the parameters defined by the last TERM command (if a HEADING statement has been used). |
4 |
5 |
The current page number (if a HEADING statement has been used). |
5 |
6 |
The current line count (if a HEADING statement has been used). |
6 |
7 |
The terminal type as set using the TERM command. |
7 |
8 |
Not currently available. |
- |
9 |
Not currently available. |
- |
10 |
Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
10 |
11 |
Returns 1 if an external list is currently active; otherwise 0. The list must have been generated by a list-generating command executed immediately prior to running the current program. |
11 |
12 |
Time in milliseconds since midnight. |
55 |
13 |
Returns 1 if typeahead data is available; otherwise 0. |
14 |
14 |
Returns 1 if typeahead data is available; otherwise 0. |
14 |
15 |
A dynamic array containing the options specified as part of the last TCL statement, as follows: Attribute 1 A string of letters corresponding to the alpha options typed. Attribute 2 The first numeric parameter. Attribute 3 The second numeric parameter. Attributes 2 and 3 are present only if the corresponding numeric parameters were specified at TCL. Note Options F, I, N, P S and T are intercepted and actioned by Reality before being passed on to the executed program. Using these options in your program may give unexpected results. See RUN for more details. |
15 |
16 |
Not currently available. |
- |
17 | Not currently available. |
- |
18 |
The current port number. |
18 |
19 | The account name. |
19 |
20 |
Not currently available. |
- |
21 |
The user's system privilege level (0, 1 or 2). |
28 |
22 |
Not currently available. |
- |
23 |
Not currently available. |
- |
24 |
Not currently available. |
- |
25 |
Not currently available. |
- |
26 |
Not currently available. |
- |
27 |
Not currently available. |
- |
28 |
Returns 1 if this is a phantom (TIPH) process; otherwise 0. |
25 |
29 |
Not currently available. |
- |
30 |
Returns 0. |
- |
31 |
Returns a NULL string. |
- |
32 |
Not currently available. |
- |
33 |
Whether the BREAK key is enabled and, if disabled, how: 0 Enabled. 1 Disabled by a DataBasic statement. It will be re-enabled automatically when the program exits. 2 Disabled from TCL. In this case, it cannot be re-enabled from a DataBasic program. 3 Disabled both by TCL and a DataBasic statement. |
23 |
34 |
Not currently available. |
- |
35 |
Returns the program source line number. |
117 |
36 |
If the current program is a subroutine, the name of the calling program. Otherwise returns a null string. |
79 (attribute 6) |
37 |
Returns 1 if running from a Proc; otherwise 0. |
27 |
38 |
Returns 0. |
- |
39 |
Not currently available. |
- |
40 |
The name of the program that is currently executing. |
40 |
41 |
Not currently available. |
- |
42 |
Not currently available. |
- |
43 |
Not currently available. |
- |
44 |
Not currently available. |
- |
45 |
Returns 0. |
- |
46 |
Not currently available. |
- |
47 |
Returns 0. |
- |
48 |
Not currently available. |
- |
49 |
Not currently available. |
- |
50 |
The release number of Reality. |
41 |
51 |
Returns 0. |
- |
52 |
Returns 0. |
- |
53 |
Returns 0. |
- |
54 |
Returns 0. |
- |
55 |
Not currently available. |
- |
56 |
Returns 0. |
- |
57 |
Not currently available. |
- |
58 |
Not currently available. |
- |
59 |
System type. Returns 2 (mvBase). |
- |
101 |
Not currently available. |
- |
102 |
Not currently available. |
- |
103 |
The current level of PERFORM statement - PERFORMs can be nested 32 levels deep. If the current program was run from TCL, returns 0. |
16 |
116 |
Returns 1 if running from a Proc; otherwise 0. |
27 |
117 |
The user's system privilege level (0, 1 or 2). |
28 |
120 |
Returns 1 if the program was run via a command definition item created when the program was cataloged. If the program was executed using RUN or DEBUG, returns 0. |
20 |
121 |
Returns the assigned option flags, formqueue file name and assigned copies for the first report spooled for the currently running port. |
58 (attribute 1, values 5, 3 and 6) |
126 |
Not currently available. |
- |
999 |
Not currently available. |
- |
D3
In D3 mode, the SYSTEM function supports the following system elements.
Element |
Return Value |
Reality Equivalent |
---|---|---|
Returns one of the following: |
0, 43 |
|
1 |
Returns 1 if the current PRINT statement destination is the printer; otherwise 0. |
1 |
2 |
The current page width as set using the TERM command. |
2 |
3 |
The current page length as set using the TERM command. |
3 |
4 |
The number of lines remaining to print on the current page, based on the parameters defined by the last TERM command (if a HEADING statement has been used). |
4 |
5 |
The current page number (if a HEADING statement has been used). |
5 |
6 |
The current line count (if a HEADING statement has been used). |
6 |
7 |
The terminal type as set using by the TERM command. |
7 |
8 |
Tape block size. |
96 |
9 |
The CPU usage for this process in milliseconds. |
9 |
10 |
Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
10 |
11 |
If an external list is currently active, returns the number of items in the list; otherwise, returns 0. The list must have been generated by a list-generating command executed immediately prior to running the current program. |
- |
12 |
Time in milliseconds since midnight. |
55 |
13 |
Sleeps for 100ms and then returns 1. |
- |
14 |
Returns 1 if typeahead data is present; otherwise 0. |
14 |
15 |
A dynamic array containing the options specified as part of the last TCL statement, as follows: Attribute 1 A string of letters corresponding to the alpha options typed. Attribute 2 The first numeric parameter. Attribute 3 The second numeric parameter. Attributes 2 and 3 are present only if the corresponding numeric parameters were specified at TCL. |
15 |
16 |
The current level of PERFORM statement. PERFORMs can be nested 32 levels deep. |
16 |
17 |
Not currently available. |
- |
18 | Maximum port number. |
93 |
Returns a unique identifier based on the date and time, with a suffix to make this unique if necessary. |
94 |
|
20 |
Returns the print job-id of the last spooler entry created by this process. The print job-id consists of the spooler job-name (as specified using SP-ASSIGN) followed by the job number. If there is no spooler entry, returns null. |
103 |
21 |
The current date in internal format with a sequential numeric suffix. |
95 |
22 |
The current port number. |
18 |
23 |
Returns 1 if the user's system privilege level is 2; otherwise, 0. |
- |
24 |
Returns 1 if this is a phantom (TIPH) process; otherwise 0. |
25 |
25 |
Not Supported. |
- |
26 |
Returns 1 if capturing is on; otherwise 0. |
91 |
27 |
Returns 1. |
- |
28 |
Returns 1 if the current DataBasic program is data case sensitive; otherwise 0. |
101 (attribute 3) |
29 |
Not Supported. |
- |
30 |
The number of the port holding the lock, when this process last attempted to read a locked item. |
43 |
31 |
Returns the formqueue file name for the first report spooled for the currently running port. |
58 (attribute 1, value 3) |
32 |
The file frame size in bytes. |
29 |
33 |
If the current program is a subroutine, returns the name of the DataBasic program that called the subroutine; otherwise, returns a null string. |
79 (attribute 6) |
34 |
Not Supported. |
- |
35 |
The number of physical ports. |
92 |
36 |
Returns 0. |
- |
37 |
Not Supported. |
- |
38 |
Not Supported. |
- |
39 |
Returns 0. |
- |
40 |
Tape reel number. |
97 |
41 |
Returns 0. |
- |
42-99 |
Not used. |
- |
100 |
Not Supported. |
- |
101+ |
Not used. |
- |
UniVerse
In UniVerse mode, the SYSTEM function supports the following system elements.
Element |
Return Value |
Reality Equivalent |
---|---|---|
0 |
Not currently available. |
- |
1 |
Returns 1 if the current PRINT statement destination is the printer; otherwise 0. |
1 |
2 |
The current page width as set using the TERM command. |
2 |
3 |
The current page length as set using the TERM command. |
3 |
4 |
The number of lines remaining to print on the current page, based on the parameters defined by the last TERM command (if a HEADING statement has been used). |
4 |
5 |
The current page number (if a HEADING statement has been used). |
5 |
6 |
The current line count (if a HEADING statement has been used). |
6 |
7 |
The terminal type as set using by the TERM command. |
7 |
8,tapeUnit |
Not currently available. |
- |
9 |
The CPU usage for this process in milliseconds. |
9 |
10 |
Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
10 |
11 |
Returns 1 if an external list is currently active; otherwise 0. The list must have been generated by a list-generating command executed immediately prior to running the current program. |
11 |
12 |
The current system time as the number of seconds since midnight. |
- |
13 |
Not used. Returns False. |
- |
14 |
Not used. Returns False. |
- |
15 |
Not used. Returns False. |
- |
16 |
Returns 1 if running from a Proc; otherwise 0. |
27 |
17 |
Not used. Returns False. |
- |
18 |
The current port number. |
18 |
19 |
The account name. This is retrieved directly from SYSTEM. |
19 |
20 |
Not used. Returns False. |
- |
21 |
Not used. Returns False. |
- |
22 |
Not used. Returns False. |
- |
23 |
Returns 1 if the Break key is enabled; otherwise 0. |
- |
24 |
Returns 1 if character echoing is enabled; otherwise 0. |
24 |
25 |
Returns 1 if this is a phantom (TIPH) process; otherwise 0. |
25 |
26 |
The current prompt character. |
26 |
27 to 30 |
Not currently available. |
- |
31 |
System serial number. |
22 (attribute 1) |
32 to 38 |
Not currently available. |
- |
42 |
Returns null. |
- |
43 to 61 |
Not currently available. |
- |
91 |
Returns 1 if capturing is on; otherwise 0. Returns 0; on Windows NT, returns 1. |
91 |
99 |
The current system time as the number of seconds since midnight. |
- |
100 to 107 |
Not currently available. |
- |
1001 |
Not currently available. |
- |
1017 |
Not currently available. |
- |
1021 |
Not currently available. |
- |
1200 to 1203 |
Not currently available. |
- |