The SYSTEM() function returns information regarding the status of various aspects of the system. On the PDA version of QM, key values that are inappropriate return a zero value.
Format
SYSTEM(key)
where
key | identifies the information to be returned. |
The SYSTEM() function is provided for compatibility with other data management products. Many of the key values correspond to those found in other multivalue database products though some values are implemented inconsistently across products. Values 1000 and above are usually specific to QM.
The following key values are implemented. All other key values return a zero value.
Key Function
1 | Returns 1 if a PRINTER ON statement is in effect |
2 | Current page width of the default print unit |
3 | Current page length of the default print unit |
4 | Lines remaining on current page of the default print unit |
5 | Current page number of the default print unit |
6 | Current line number of the default print unit |
9 | Cumulative processor time used (mS) by this QM session |
10 | Input waiting in the DATA queue? (1 if so, 0 if not) |
11 | Select list 0 active? (1 if so, 0 if not) |
12 | Time in seconds since midnight (same as TIME()) |
23 | Break key enabled? (1 if so, 0 if not) |
24 | Input echo enabled? (1 if so, 0 if not) |
25 | Is this a phantom process? |
26 | Returns the current input prompt character |
27 | Returns the operating system uid for the user's process. (Not Windows or PDA) |
28 | Returns the operating system effective uid for the user's process. (Not Windows or PDA) |
29 | Returns the operating system gid for the user's process. (Not Windows or PDA) |
30 | Returns the operating system effective gid for the user's process. (Not Windows or PDA) |
32 | Returns the system directory pathname |
38 | Returns temporary directory pathname |
42 | Returns telnet connection IP address, null for a console user |
91 | Returns 1 on Windows, 0 on other platforms |
1000 | Returns 1 if EXECUTE CAPTURING is in effect, 0 otherwise |
1001 | Returns 1 if case inversion is enabled, 0 otherwise |
1002 | Returns the program call history. This is a dynamic array in which each program is represented by a field, the current program being in field 1. The first value in each field contains the program name. Subsequent values are divided into two subvalues containing the program address and line number (where available) for each internal subroutine call (GOSUB) in the program. |
1003 | Returns a dynamic array containing a list of open files. Each field has two values; the first holds the internal file number, the second holds the file's pathname. |
1004 | Returns the peak number of files that have been open at one time since QM was started. |
1005 | Returns the combined date and time value as DATE() * 86400 + TIME(). |
1006 | Returns 1 if running on a Windows NT style system (NT and later). |
1007 | Returns the current transaction number, zero if not in a transaction. |
1008 | Returns the current transaction level, zero if not in a transaction. |
1009 | Returns the system byte ordering, 1 for high byte first, 0 for low byte first. |
1010 | Returns the platform name; Windows, Linux or FreeBSD. |
1011 | Returns the pathname of the QM configuration file (qm.ini on Windows, qmconfig on other platforms) |
1012 | Returns the QM version number. |
1013 | Returns user limit, excluding users reserved for phantom processes. |
1014 | Returns user limit, including users reserved for phantom processes. |
1015 | Returns the name of the host computer system. |
1016 | Returns the remaining number of licensed non-phantom users. |
1017 | Returns the tcp/ip port number for a socket connection. |
1018 | Returns the device licensing ip address limit. |
1019 | Returns the device licensing current ip address count. |
1020 | Returns the time of day in milliseconds since midnight. |
1024 | Returns the current working directory pathname when QM was entered. |
1025 | Returns a dynamic array where field 1 is a multivalued list of environment variable names and field 2 is a corresponding list of their values. |
1026 | Returns xxx when QM is entered using "qm xxx". |
1027 | Returns the name of the serial port when logged in on a serial connection. |
1028 | Returns the system id of the active QM licence, zero if the licence is not system specific. |
1029 | Returns the current internal subroutine depth. |
1030 | Returns login time as date * 86400 + time. |
1031 | Returns operating system process id. |
1032 | Returns and clears the break pending flag, set if the break key is pressed with breaks disabled. |
QM allows users to add definitions for their own SYSTEM() function key values by writing a QMBasic subroutine that performs whatever processing is required. This subroutine takes two arguments. The first is used to return the result and the second is the key value passed in. This subroutine must be catalogued as $SYSTEM.
|