SYSTEM Function
Provides access to the current states of various system parameters.
Syntax
SYSTEM(parameter)
Syntax elements
parameter An expression that evaluates to the number of the required system parameter.
Operation
The following system parameters are available:
Parameter |
Return Value |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns one of the following: |
|||||||||||||||||||||||||||||||||||||
1 |
Returns 1 if the current PRINT statement destination is to the printer; otherwise 0. |
||||||||||||||||||||||||||||||||||||
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 the TERM command. |
||||||||||||||||||||||||||||||||||||
8 |
Not used; returns 0. |
||||||||||||||||||||||||||||||||||||
9 |
The CPU usage for this process in milliseconds, accurate to the nearest 20 ms. |
||||||||||||||||||||||||||||||||||||
10 |
Returns 1 if the stack (STON) is currently enabled (that is, if stacked input is currently available); otherwise 0. |
||||||||||||||||||||||||||||||||||||
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. |
|||||||||||||||||||||||||||||||||||||
12 |
The current system time as the number of tenths of a second since midnight, accurate to the nearest second. |
||||||||||||||||||||||||||||||||||||
13 |
Sleeps for 100ms and then returns 0. |
||||||||||||||||||||||||||||||||||||
Returns 1 if typeahead data is available; otherwise 0. |
|||||||||||||||||||||||||||||||||||||
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. |
|||||||||||||||||||||||||||||||||||||
16 |
The current level of PERFORM statement - PERFORMs can be nested 32 levels deep. If the current program was run from TCL, returns 0. |
||||||||||||||||||||||||||||||||||||
17 |
Not used; reserved. |
||||||||||||||||||||||||||||||||||||
The current port number. |
|||||||||||||||||||||||||||||||||||||
The account name. This is retrieved directly from SYSTEM. |
|||||||||||||||||||||||||||||||||||||
20 |
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. |
||||||||||||||||||||||||||||||||||||
Returns the type of visual characteristics supported by the current TERMTYPE, as follows: 0 Invalid. 1 Video characteristics not supported. 2 Video character requires a CRT position. 3 CRT position is not required. |
|||||||||||||||||||||||||||||||||||||
Returns the following system configuration parameters as a dynamic array. 1 System serial number. 2 Not applicable to Reality on UNIX or Windows; always 0. 3 Not applicable to Reality on UNIX or Windows; always 0. 4 Wordmate (1 if allowed; otherwise 0). Always 1 for Reality on UNIX or Windows. 5 Number of ABS frames; always 2047, indicating compatibility with Release 7.0. 6 Maximum number of processes. 7 Not applicable to Reality on UNIX or Windows; always -1. 8 Not applicable to Reality on UNIX or Windows; always 0. 9 Number of workspace frames. 10 Maximum 'real' port number (see MaxPortNum database configuration parameter). 11 1 if a UK system; otherwise 0. 12 Memory size in Kbytes. 13 System environment type (3=Reality on UNIX or Windows; 0, 1, 2 = proprietary Reality). |
|||||||||||||||||||||||||||||||||||||
23 |
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. |
||||||||||||||||||||||||||||||||||||
24 |
Returns 1 if character echoing is enabled; otherwise 0. |
||||||||||||||||||||||||||||||||||||
25 |
Returns 1 if this is a phantom (TIPH) process; otherwise 0. |
||||||||||||||||||||||||||||||||||||
26 |
The current prompt character. |
||||||||||||||||||||||||||||||||||||
27 |
Returns 1 if running from a Proc; otherwise 0. |
||||||||||||||||||||||||||||||||||||
28 |
The user's system privilege level (0, 1 or 2). |
||||||||||||||||||||||||||||||||||||
29 |
The file frame size in bytes. |
||||||||||||||||||||||||||||||||||||
30 |
Returns 1 if pagination is in effect; otherwise 0. |
||||||||||||||||||||||||||||||||||||
31 |
Reserved; returns 0. |
||||||||||||||||||||||||||||||||||||
32 |
Reserved; returns 0. |
||||||||||||||||||||||||||||||||||||
33 |
Reserved; returns 0. |
||||||||||||||||||||||||||||||||||||
34 |
Reserved; returns 0. |
||||||||||||||||||||||||||||||||||||
The number of the language currently in use (denationalisation). |
|||||||||||||||||||||||||||||||||||||
36 |
Not used; returns 0. |
||||||||||||||||||||||||||||||||||||
37 |
The thousands separator currently in use (denationalisation). |
||||||||||||||||||||||||||||||||||||
38 |
The decimal separator currently in use (denationalisation). |
||||||||||||||||||||||||||||||||||||
39 |
The money sign currently in use (denationalisation). |
||||||||||||||||||||||||||||||||||||
40 |
The name of the program that is currently executing. |
||||||||||||||||||||||||||||||||||||
41 |
The release number of Reality. |
||||||||||||||||||||||||||||||||||||
42 |
Not used; returns 0. |
||||||||||||||||||||||||||||||||||||
The number of the port holding the lock, when this process last attempted to read a locked item. |
|||||||||||||||||||||||||||||||||||||
44 |
Returns the system environment type (3=Reality on UNIX/Windows, 0, 1, 2 = proprietary Reality). |
||||||||||||||||||||||||||||||||||||
45 |
Returns 1 if the last item read was a binary item; otherwise 0. |
||||||||||||||||||||||||||||||||||||
46 |
Returns 1 if the last item read was a D-pointer; otherwise 0. |
||||||||||||||||||||||||||||||||||||
47 |
Returns 1 if currently inside a transaction; otherwise 0. |
||||||||||||||||||||||||||||||||||||
48 |
The CCI (Consistent Circuit Identifier). A value of -1 is returned for TIPH processes or if the CCI has not been defined in the NETWORK file. |
||||||||||||||||||||||||||||||||||||
49 |
The PLId (Physical Location Identifier). Null is returned for TIPH processes. |
||||||||||||||||||||||||||||||||||||
50 |
User-ID. |
||||||||||||||||||||||||||||||||||||
51 |
Software user-ID (which can be multivalued). |
||||||||||||||||||||||||||||||||||||
52 |
Database name. |
||||||||||||||||||||||||||||||||||||
53 |
Not applicable to Reality on UNIX or Windows; returns 0. |
||||||||||||||||||||||||||||||||||||
54 |
Not applicable to Reality on UNIX or Windows; returns 0. |
||||||||||||||||||||||||||||||||||||
55 |
Time in milliseconds since midnight. |
||||||||||||||||||||||||||||||||||||
56 |
Not applicable to Reality on UNIX or Windows; returns 0. |
||||||||||||||||||||||||||||||||||||
57 |
Snapshot of the overflow table as a dynamic array of four attributes: 1 Number of calls to get table space. 2 Number of frames requested from table. 3 Number of calls to return frames. 4 Number of frames given back to table. |
||||||||||||||||||||||||||||||||||||
The spooler assignment table data for the currently running port. This information is similar to
Note that subvalues 1 and 4 will be the same if subvalue 1 is the name of a D-pointer. |
|||||||||||||||||||||||||||||||||||||
59 |
Not used by Reality on UNIX or Windows; returns 0. |
||||||||||||||||||||||||||||||||||||
The TCL command line without the verb, redundant spaces, or options and with spaces replaced by attribute marks (that is, as a dynamic array). Use this function in place of OCONV('','U20E0'). Note The SENTENCE function provides greater flexibility and should be preferred to SYSTEM(60). |
|||||||||||||||||||||||||||||||||||||
61 |
The name of the physical account (D-pointer) onto which the process is logged. |
||||||||||||||||||||||||||||||||||||
62 |
The last input delimiter used. |
||||||||||||||||||||||||||||||||||||
A dynamic array containing the current security setting for SQL Stored Procedures. The format of this array is as follows: Attribute 1 1 - enabled or restricted. Attribute 2 The file specifier of the associated Restricted Access Lookup File, if any. Only valid if Attribute 1 is set to 1. |
|||||||||||||||||||||||||||||||||||||
64 |
A dynamic array containing the current security setting for Remote Basic. The format of this array is the same as for parameter 63. |
||||||||||||||||||||||||||||||||||||
65 |
A dynamic array containing the current security setting for Dictionary Basic. The format of this array is the same as for parameter 63. |
||||||||||||||||||||||||||||||||||||
66 |
A dynamic array containing the current security setting for User Exits. Attributes 1 and 2 of this array are the same as for parameter 63. Attribute 3 contains a file specifier if logging is required; otherwise, null. |
||||||||||||||||||||||||||||||||||||
67 |
The item-id of the current security profile. |
||||||||||||||||||||||||||||||||||||
68 |
The path of the current user's alternate verbs file. |
||||||||||||||||||||||||||||||||||||
69 |
Reserved; returns 0. |
||||||||||||||||||||||||||||||||||||
70 |
The type of the underlying host system, as follows: 0 Proprietary Reality. 1 UNIX. 2 Windows. |
||||||||||||||||||||||||||||||||||||
71 |
The version number of the current live version of Reality. |
||||||||||||||||||||||||||||||||||||
72 |
Resets the currently selected tape unit, used by SYSTEM(73), to one and returns the maximum number of tape devices defined on the database. Note This SYSTEM call can be used with SYSTEM(73) to supply tape assignment information for each tape unit on the database, in a format which is easy to process. |
||||||||||||||||||||||||||||||||||||
73 |
The magnetic tape assignment information for the currently selected tape unit. The selected tape unit is initialised to 1 by SYSTEM(72) and incremented by one after each The tape assignment information displayed is as follows: unit.no^tapetype^channel^status^blocksize^density^reel^userid^port^devicepath tapetypeThe tape type as defined in the database configuration file. statusCorresponds to DENAT messages in message 0 class 9. useridSet to null if on the same database. If not on the same database, set to the UNIX user-id or, on Windows, the database name. devicepathThe path of the tape device on the local host. |
||||||||||||||||||||||||||||||||||||
74 |
Returns 1 if DDA session level messaging is supported; otherwise 0. |
||||||||||||||||||||||||||||||||||||
75 |
The resilience mode - one of the following values: 0 Stand-alone - resilience not active. 1 Stand-alone - transaction handling. 2 Stand-alone - transaction handling and logging. 3 Shadow. 4 Failsafe - primary. 5 Failsafe - secondary. 12 Failsafe - primary (failed). 13 Failsafe - secondary (failed). |
||||||||||||||||||||||||||||||||||||
76 |
Returns 1 if the current user is the database owner; otherwise 0. |
||||||||||||||||||||||||||||||||||||
77 |
The database type. Returns one of the following values: 0 Filestore database. 1 Partition database. |
||||||||||||||||||||||||||||||||||||
Program information. Returns a dynamic array containing the following: 1 The account from where the program was compiled/cataloged. 2 The name of the file from where the program was compiled/cataloged. 3 The item-id of the compiled item. 4 Not used, reserved. 5 The name of the file containing the source item. 6 The item-id of the source item. 7 Not used, reserved. 8 The name of the compiler used to compile the program. 9 A subvalued list of COMMON variable names. 10 Not used, reserved. 11 Not used, reserved. 12 Not used, reserved. |
|||||||||||||||||||||||||||||||||||||
79 |
If the current program is a subroutine, information about the calling program, as in 78 above. Otherwise returns a null string. |
||||||||||||||||||||||||||||||||||||
80 |
The UNIX host's network node name. On Windows, returns null. |
||||||||||||||||||||||||||||||||||||
81 |
The id of the current host process. |
||||||||||||||||||||||||||||||||||||
82 |
The id of the parent host process. |
||||||||||||||||||||||||||||||||||||
83 |
The UNIX user number. On Windows, returns null. |
||||||||||||||||||||||||||||||||||||
84 |
The UNIX group number. On Windows, returns null. |
||||||||||||||||||||||||||||||||||||
85 |
A dynamic array containing a list of UNIX group numbers. On Windows, returns null. |
||||||||||||||||||||||||||||||||||||
86 |
A dynamic array containing the host command line used to run Reality. White space is replaced by attribute marks. |
||||||||||||||||||||||||||||||||||||
87 |
The local console path. On Windows, returns null. |
||||||||||||||||||||||||||||||||||||
88 |
The current working directory; that is, the directory from which Reality was started. |
||||||||||||||||||||||||||||||||||||
89 |
Returns a dynamic array containing the host environment variables and their values, in the format produced by the set host command. |
||||||||||||||||||||||||||||||||||||
90 |
Date format: 1 = International (dd/mm/yy), 0 = USA (mm/dd/yy). |
||||||||||||||||||||||||||||||||||||
91 |
Returns 1 if capturing is on; otherwise 0. |
||||||||||||||||||||||||||||||||||||
92 |
Number of physical ports. |
||||||||||||||||||||||||||||||||||||
93 |
Maximum port number. |
||||||||||||||||||||||||||||||||||||
Returns a unique identifier based on the date and time, with a suffix to make this unique if necessary. |
|||||||||||||||||||||||||||||||||||||
95 |
Not currently used. |
||||||||||||||||||||||||||||||||||||
96 |
Tape block size. |
||||||||||||||||||||||||||||||||||||
97 |
Tape reel number. |
||||||||||||||||||||||||||||||||||||
Returns the current Multivalue video mode, as follows:
The video mode is controlled by the @ compatibility option, the state of which is determined by the compatibility mode set with the $OPTIONS statement. Refer to the DataBasic @ function for details of the video codes available in Reality mode. The topic @ compatibility option lists codes for other modes. |
|||||||||||||||||||||||||||||||||||||
99 |
Not currently used. |
||||||||||||||||||||||||||||||||||||
Returns 1 if the database supports case-insensitive item-ids; otherwise 0. |
|||||||||||||||||||||||||||||||||||||
Returns a dynamic array containing the current state of case sensitivity, as follows: Attribute 1 TCL data case sensitivity: 1 if case sensitive; otherwise, 0. Attribute 2 Keyword case sensitivity: 1 if case sensitive; otherwise, 0. Attribute 3 DataBasic data case sensitivity: 1 if case sensitive; otherwise, 0. Note When SYSTEM(101) is called from Proc, attribute 3 is always the same as attribute 1. |
|||||||||||||||||||||||||||||||||||||
Returns the current vendor emulation (as set in the database configuration file), as follows:
|
|||||||||||||||||||||||||||||||||||||
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. |
|||||||||||||||||||||||||||||||||||||
104 |
Returns 1 if the SYSTEM file has case-insensitive item-ids; otherwise 0. |
||||||||||||||||||||||||||||||||||||
105 |
Returns 1 if the NETWORK file has case-insensitive item-ids; otherwise 0. |
||||||||||||||||||||||||||||||||||||
106 |
Returns 1 if the USERS file has case-insensitive item-ids; otherwise 0. |
||||||||||||||||||||||||||||||||||||
107 |
Returns 1 if the SECURITY file has case-insensitive item-ids; otherwise 0. |
||||||||||||||||||||||||||||||||||||
108 |
Returns 1 if the host file system is case-insensitive; otherwise 0. |
||||||||||||||||||||||||||||||||||||
Returns the current value of the user-defined TCL logging string, set with the SYSTEM(109) or ASSIGN statement. |
|||||||||||||||||||||||||||||||||||||
Returns the date when the most recently read item was last updated: [InternalDate] The internal date format is the number days since 31 December 1967. |
|||||||||||||||||||||||||||||||||||||
Returns the time when the most recently read item was last updated: [SecondsFromMidnight] The internal time format is the number of milliseconds since midnight. The granularity is 1000 milliseconds (that is, one second). |
|||||||||||||||||||||||||||||||||||||
112 |
No longer used. Before Reality V15.2, SYSTEM(112) returned the minimum password length specified by the |
||||||||||||||||||||||||||||||||||||
116 |
Returns the call stack. SYSTEM(116) returns a multi attribute string with the first attribute always containing the current module name and the line number. If called from the main program (that is, with nothing on the stack) it also returns a second attribute consisting of the string If called with within a subroutine it returns an additional attribute for each level of call stack, consisting of a single type character followed by the calling module name and the line number. The type character is: |
||||||||||||||||||||||||||||||||||||
117 |
Returns the program source line number. |
||||||||||||||||||||||||||||||||||||
118 |
Returns the program line number. |
||||||||||||||||||||||||||||||||||||
119 |
Returns the name of the current user password definition. |
||||||||||||||||||||||||||||||||||||
120 |
Returns the name of the current operating environment. |
||||||||||||||||||||||||||||||||||||
121 |
Returns the name of the current default DataBasic compiler. This is either the default compiler specified for the current operating environment or, if none, the compiler identified by the Note that SYSTEM(121) does not resolve synonym entries. |
MultiValue compatibility
Refer to MultiValue Compatibility.
Examples
This example prints the current prompt character (? for example):
Y = SYSTEM(26)
PRINT Y
The next example prints the value of the second attribute (keyword case sensitivity) of the array containing the current state of case sensitivity:
A = SYSTEM(101)
B = A<2>
PRINT B