$MACHINE
The $MACHINE system variable contains a value based on the hardware and system software currently being used. $MACHINE may legally be used anywhere an alpha variable would be used except on the left hand side of an assignment statement. See below for a list of the $MACHINE byte settings.
Byte(s) | Contents |
---|---|
1 | Operating system type,
U for UNIX, N for MS Windows, |
2 | Bit field for the terminal capabilities (see also byte 53): HEX(01) Windows drawn with WINDOW OPEN are done by the terminal. HEX(04) Screen saving (HEX(0000)) is done locally HEX(08) Support $DECLARE HEX(10) Support for 32 bit $DECLARE HEX(20) Client uses an 8 bit character set HEX(40) Client supports KCML forms HEX(80) Client running on Windows CE |
3 | Monitor type, " " (Blank) dumb terminal, "W" Kclient, DW or WDW |
4 |
Text mode box graphics enabled:
"G" enabled or " " no graphics available |
5 | Not used, HEX(00) |
6 | Current number of users at start up, not counting the current process. |
7 | KCML version, "I" for the interpretive version, "P" for the non-interpretive run time only version. |
8 | Screen width in binary, taken from the Columns clause in terminals TERMINFO definition, HEX(50) by default |
9 | Terminal type, taken from the TermCode clause in the terminals TERMINFO definition. |
10 | Math coprocessor present, always HEX(01) on UNIX versions. On DOS versions HEX(01) if the coprocessor is present, otherwise HEX(00). |
11 | Not used, always HEX(02) |
12 |
Number of colors available,
HEX(02) monochrome screen, HEX(10) color PC or Color Magna |
13 | Maximum number of users allowed, if greater than 255 then this field is set to HEX(FF). |
14-15 | Not used, HEX(00) |
16 | Maximum number of device table entries available, always 255 HEX(FF)) |
17 | Number of device table entries in use, in binary. |
18 |
Indicates whether or not the current partition in use was started in a background partition.
HEX(00) if started in foreground HEX(01) if started in background |
19 |
Keyboard redirection and logging status.
HEX(00) normal keyboard input |
20-22 | Not used, HEX(00) |
23 | Last mouse row position, set to HEX(FF) if no mouse found. |
24 | Last mouse column position, set to HEX(FF) if no mouse found. |
25 | Most significant bit of the current user count |
26 | Least significant bit of the current user count |
27 | Most significant bit of the maximum users allowed. |
28 | Least significant bit of the maximum users allowed. |
29 |
The keyboard shift state during a mouse event: HEX(00) No mouse present HEX(01) Mouse present HEX(02) Shift down HEX(04) Ctrl down HEX(08) Alt down HEX(10) Drag in progress HEX(40) Non-client area drag event |
30-32 | Not used |
33 | Terminal language code as deduced by KClient from Windows |
34-35 | Maximum value of #TERM |
36-37 | Maximum value of #PART |
38-39 | Number of kclient users at startup |
40-41 | Maximum kclient users allowed by license |
42 | Type of license HEX(01) Client server HEX(02) Peer-to-Peer WKCML LAN with license server HEX(04) Single user |
43-44 | Local timezone offset from GMT in minutes. |
45-48 | Server IP address. Zero if direct connect (WKCML). |
49-52 | Client IP address. Zero if direct connect (WKCML). |
53 | Second bitfield for terminal capabilities (see also byte 66): HEX(01) Client is running on a Netier NT terminal HEX(02) Client is running on a Citrix or WTS thin client HEX(04) Client is connected directly (i.e. client and server are running as one process and not in client server mode). This is the mode in which the WKCML product always runs. HEX(08) Client is a Unicode version. HEX(10) Reserved. HEX(20) Client is running on a Wyse NT terminal. HEX(40) Browser client. HEX(80) Reserved. |
54 | A bit field indicating optional features set during connection or compiled into KCML HEX(01) Can access files up to 4 Terabytes else up to 2 Gigabytes HEX(02) Pseudo-tty support is enabled for SHELL, always true for telnet connections HEX(04) Client was authenticated and $LOGNAME is reliable HEX(08) A service has been selected and an appropriate environment set up. $SERVICE is reliable. This could have been done by either the connection manager or KCML executing CALL KI_CONNECT. HEX(10) A process global started as kcml -g and using shared memory. HEX(20) The server supports server-side $DECLARE HEX(40) Non-telnetd connection. Either connect to inetd using kcml -l or started via the Connection Manager HEX(80) KCML started via the Connection Manager only. |
55-56 | A two byte field holding the number of distinct users logged on before the current KCML process started. This is the count used by KCML to compare against maximum in the license file. |
57 | $COMPLIANCE language support. 1 means the code must comply with stricter rules, which currently are that all DEFSUB must be matched by an ENDSUB and all variables must be dimmed. See $COMPLIANCE. |
58 | Bitfield for server mode: HEX(01) KCML is running as a SOAP server HEX(02) KCML will render forms as XML HEX(04) KCML is a persistent application or SOAP server |
59 | Bitfield indicating the encoding used by the server when interpteting data to be printed or sent to the client. HEX(00) Server using the locale of the client (the default unless the environment variable USING_UTF8 is set). HEX(01) Server expects all data to be UTF-8 encoded. |
60 | Bitfield indicating the development functionallity permitted by the license file. HEX(01) Reserved HEX(02) Programmable - code can be viewed, variables inspected, read only mode. HEX(04) Limited debugging - program flow can be changed, variables modified, read/write mode. HEX(08) Full Workbench support for writing/modifying programs and debugging. HEX(10) Reserved for application use. All other bits are reserved. |
61 | Bitfield indicating features in this particular build of kcml. HEX(01) Debug build. This build of kcml contains debug information to help in the development of kcml or to help the diagnosis of problems within kcml. Debug builds are larger, slower and consume more memory than normal release builds. HEX(02) KCML7 runtime. Set when running a program compiled with the KCML7 compiler kc. HEX(04) 32-bit syms. This build of KCML supports 32-bit syms. The libraries are not compatible with 16-bit sym builds. |
62 | Bitfield indicating client server architecture HEX(01) Client is little endian (e.g. Intel x86). If unset then assume big endian. HEX(02) Client is 64 bit, if unset assume 32 bits HEX(10) Server is little endian (e.g. Intel x86). Otherwise assumed to be big endian. HEX(20) Server is 64 bit, if unset assume 32 bits |
63 | $RELEASE status. The bottom 7 bits are incremented in $RELEASE child process. The HEX(80) bit is set after the function returns in the parent and indicates that at least one $RELEASE has been executed in this process. |
64 | $PSTAT width. Size of a partition expressed as a power of 2. Can be changed by the presence of /etc/kcml/pstat_X. See Configuring $PSTAT. |
65 | Reserved |
66 | Third bitfield for terminal capabilities (see also byte 2): HEX(01) Client is running on browser shim |
67 | Authentication type HEX(00) User and password HEX(01) Single sign-on |
The defined size of $MACHINE is currently 128 bytes.
$MACHINE as a record
KCML defines a KCML_MACHINE built in DEFRECORD that can be used to access the fields in $MACHINE e.g.
maxpart = FLD($MACHINE.MACHINE_MaxPart)
Syntax examples:
Os$ = FLD($MACHINE.MACHINE_OSType$)
IF (STR($MACHINE,18,1) == HEX(00))
See also: