Omnis Classic sys() Function Values
The sys(n) function in Omnis Classic and Omnis Studio returns system, environment, and runtime information based on the numeric parameter n.
This is a reference to the most commonly used and historically known values.
Standard sys(n) Return Values
n | Description |
|---|---|
| 1 | Omnis version number |
| 2 | Program type flags (full program, runtime, eval, Unicode) |
| 3 | Company name from installation |
| 4 | User name from installation |
| 5 | Serial number entered at install |
| 6 | Platform code (N = Windows NT/2000+, U = Linux, X = macOS) |
| 7 | Operating system version string (e.g. 6.2 for Windows 10) |
| 8 | Omnis platform type (MAC64, WIN32, WIN64, UNIX) |
| 9 | Path separator (\ or /) |
| 10–20 | Pathnames of open data segments (10 is library file) |
| 21 | Print file pathname |
| 22 | Import file pathname |
| 23 | Port name |
| 24 | Report device (Printer, Screen, etc.) |
| 30–49 | UI menus |
| 50–79 | Open windows |
| 80 | Current report name |
| 81 | Current search name |
| 82 | Main file name |
| 83 | Number of records in main file |
| 85–90 | Method/event context |
| 91–94 | Separator constants (decimal, thousand, param, field) |
| 101 | Printer name and network path |
| 104–105 | Screen width/height (pixels) |
| 106–109 | Memory details (platform dependent) |
| 110–114 | Deprecated CPU/Apple ROM/event support data |
| 115 | Writable files folder path |
| 116 | Unix lowercase config flag |
| 120–121 | Windows dialog unit sizes |
| 122 | WebClient listener started (boolean) |
| 123 | Omnis executable build number |
| 185, 196, 205, 209, 210, 212, 215–216, 218, 235–256 | Various newer context/environment/system info like method metadata, library lists, endianness, processors count, UI sort details, executable and app paths, PDF output folders, license count, dark mode, etc. |
The Curious Case of Undocumented Extras
Some sys() codes exist outside the official range, often discovered by the community:
n | Description |
|---|---|
| 7 (old use) | In earlier Omnis versions, returned OS sub-types (e.g. 4.0 for Win95/NT, 3.10 for Win3.1, 1 for PPC). Modern use: OS version string. |
| 115 (old use) | Path of omnis.exe from version 7.3.7 onward in older Classic builds. |
| 202 | Returns library and omnis.exe directory; "W" marks the working directory (works if .lbr is associated with Omnis). |
| 2000–2003 | Internal timing and profiling: start, stop, reset timers, and print tick report. |
Summary
- 1–256: Well-documented system/environment values.
- Beyond 256: Mostly undocumented, special-purpose or legacy features.
- Behaviour may vary by Omnis version.
Tip for Classic Developers:
If you still keep that thick, dog-eared Omnis manual on the shelf, this list will feel like slipping on a favourite old jacket — comfortable and familiar, but still with a few surprises in the pockets.