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 other elements and for all elements in unlisted modes, a runtime error occurs and the function returns 0.
In mvEnterprise mode, the SYSTEM function supports the following system elements.
Element | Return Value |
---|---|
0 | Not currently available. |
1 | Returns 1 if the current PRINT statement destination is the printer; otherwise 0. |
2 | The current page width as set using the TERM command. |
3 | The current page length as set using the TERM command. |
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). |
5 | The current page number (if a HEADING statement has been used). |
6 | The current line count (if a HEADING statement has been used). |
7 | The terminal type as set using by the TERM command. |
8 | Not currently available. |
9 | The CPU usage for this process in milliseconds. |
10 | Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
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. |
13 | Sleeps for 100ms and then returns 0. |
14 | Returns 1 if typeahead data is present; otherwise 0. |
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. The internal variables containing the two numeric values are used by some system subroutines. They should be retrieved early in the program to avoid getting incorrect values. |
16 | The current level of PERFORM statement. PERFORMs can be nested 32 levels deep. |
17 | The user's system privilege: if SYS2, returns 1; otherwise 0. |
18 | The number of physical ports. |
19 | Not currently available. |
20 | Not currently available. |
21 | The number of the port on which the current process is running. |
22-99 | Not used. |
100 | Not currently available. |
101 | The maximum available port number. |
102+ | Not used. |