| Function group | Execute on client | Platform(s) |
| General | NO | All |
sys(number)
Returns information about the current system depending on a number argument.
Using the sys() function, you can obtain system information such as the current printer name, the pathname of the current library, the screen width or height in pixels, and so on. The following example uses sys(6) to test the current OS and branches accordingly.
You can use the following number values with the sys() function.
| Number | Description |
|
1 |
returns the Omnis version number. |
|
2 |
returns the Omnis program type byte: |
|
3 |
returns your company name entered on installation. |
|
4 |
returns your name entered on installation. |
|
5 |
returns your serial number entered on installation. |
|
6 |
returns the platform code of the current executable: |
|
7 |
returns a string containing the version number of the current OS. For example, returns "4.1" under Windows XP, and "10.11.5" under macOS System Software 10.11.5 |
|
8 |
returns the platform type of the current Omnis program as a string: 'MAC64','WIN32','WIN64','UNIX' |
|
9 |
returns the pathname separator for the current platform: '\' (back slash) for Windows, '/' (forward slash) for macOS and Linux. |
|
10 |
returns the pathname of the current open library file. |
|
11,..,20 |
returns the pathname(s) of the current open data file segment(s) (empty if none are open). |
|
21 |
returns the pathname of the current print file name (empty if not open). |
|
22 |
returns the pathname of the current import file name (empty if not open). |
|
23 |
returns the current port name (empty if no port open). |
|
24 |
returns the current report device, for example, Printer, Preview, File (Preview is the default). |
|
30,..,49 |
returns the name of the installed user-defined menu(s) starting from the left-most menu (empty if none are installed). |
|
50,..,79 |
returns the name of the open user-defined window(s) starting with the top window (empty if none are open). |
|
80 |
returns the current report name (empty if no report set). |
|
81 |
returns the current search name (empty if no search set). |
|
82 |
returns the main file name (empty if no main file set). |
|
83 |
returns the number of records in main file. |
|
85 |
returns the name of currently executing method in the form class name/method number. |
|
86 |
returns a list of event parameters for the current event. The first parameter is always pEventCode containing an event code representing the event, for example, evClick for a click on a button: a second or third event parameter may be supplied which tells you more about the event |
|
87 |
returns horizontal screen resolution in pixels per inch |
|
88 |
returns vertical screen resolution in pixels per inch |
|
89 |
returns the text for the current search calculation, or empty if no calculation is set. |
|
90 |
returns the number of methods on the method stack. This does not work for client requests running in a thread of the Multi-threaded Server. |
|
91 |
returns the decimal separator |
|
92 |
returns the thousand separator |
|
93 |
returns the parameter separator for calculations |
|
94 |
returns the file class field name separator |
|
101 |
returns the current printer name, and network path (empty if not connected). |
|
104 |
returns the screen width in pixels. |
|
105 |
returns the screen height in pixels. |
|
106 |
macOS: not relevant - returns zero. Other platforms: returns the size in bytes of available physical memory. |
|
107 |
macOS: not relevant - returns zero. Other platforms: returns the total size in bytes of physical memory. |
|
108 |
macOS: not relevant - returns zero. Other platforms: returns a number between 0 and 100 that gives a general idea of current memory utilization, in which 0 indicates no memory use and 100 indicates full memory use. |
|
109 |
macOS: not relevant - returns zero. On Windows and Linux returns the unused memory in bytes. This is the number of bytes available in the paging file, added to the number of bytes of available physical memory. |
|
115 |
returns the pathname of the folder containing the installed writeable files, including the terminating path separator (on Windows this is usually a sub-folder of the AppData Local folder). To get the pathname of the folder containing the Omnis executable, use sys(215). |
|
116 |
(Linux only) returns 1 (true) if Omnis has been configured to force all file names to be lower case, 0 otherwise. |
| 118 |
returns additional information about the operating system version; this works under Windows only. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system. This function returns the operating system version information in the Windows OSVERSIONINFOEX structure, so you should obtain information about this structure for full details about the information returned (see the Microsoft web site). |
|
120 |
(Windows only) returns the width of the current dialog base-width unit based on the current system font; this differs for Small and Large font mode. |
|
121 |
(Windows only) returns the height of the current dialog base-width unit based on the current system font; this differs for Small and Large font mode. |
|
122 |
returns true if the Web Client server communications
listener started |
|
123 |
returns the build number of the Omnis executable |
| 185 |
returns the current executing method in the format: Libraryname.Classname/Methodname/Linenumber This is in addition to sys(85) which returns the current executing method in the form Classname/Methodname. |
|
190 |
returns the number of times Omnis has loaded a class from disk and added it to the memory class cache. |
|
191 |
returns the number of times Omnis deleted a memory class cache entry, when it added a class to the cache, meaning that the class deleted from the cache may need to be reloaded sys(190) and sys(191) provide information you can use to monitor the impact of changing the preference $root.$prefs.$maxcachedclasses. Too low a value for this preference may result in a performance hit, due to too many classes being repeatedly loaded from disk. |
| 192 |
sys(192) caters for both error handlers and other situations where information about the method stack might be useful. It returns a list representing the current method call stack (with a line for each line that would appear on the debugger stack menu). The first line in the list corresponds to the call to sys(192), and subsequent lines correspond to how the method running the previous line was called. The list has the following columns: classitem - item reference to the class containing the method. object - the name of the object containing the method in the class; empty if it is a class method. method - the name of the method. line - the line number in the method, of the method line resulting in the method on the previous line running. linetext - the text for the method line. params - the parameters passed to the method. This is a two-column list, with columns name and value. The value is the value that would be displayed as a variable tooltip for the parameter. methoditem - item reference to the method. inst - item reference to the instance executing the method. |
| 193 |
returns a list which is a copy of the trace log. |
| 194 |
returns the list of open windows in the IDE. The list has the following columns: windowname - the name of the window, as it would appear in the windows menu classitem - if the window is a class or method editor, the item reference to the class; otherwise null ismethodeditor - boolean, true if and only if the window is a method editor window The current line is non-zero if and only if the window is the top design window, i.e. the top class editor or method editor window. When deciding the top design window, the catalog, component store, and property inspector are ignored. |
| 195 |
returns the list of selected objects, if there is a top design window (as defined by sys(194) above), and if the top design window is a window, report, toolbar, menu, or remote form editor (NOT a method editor). The list has one column: objectitem - the item reference of the selected object |
| 196 |
returns the list of all open libraries (including private libraries) and their VCS build properties. The list has the following columns: name - the internal name of the library pathname - the pathname of the library file vcsbuildersname - the $vcsbuildersname property of the library vcsbuildnotes - the $vcsbuildnotes property of the library vcsbuilddate - the $vcsbuilddate property of the library |
| 197 | returns true (1) if running on Windows XP with themes enabled, false (0) if not. |
| 198 | returns an integer which indicates the status of binding the web client server port number to the socket on which the server receives incoming connections. The value is -1 if bind has not been attempted yet, 0 if bind was successful, or a positive value (a socket layer error code) if the bind failed |
| 199 | returns a list with a row for each method command. The list has two columns: column 1 is the command group, column 2 is the command name |
| 202 | returns the command line parameters passed to Omnis |
| 203 | (Win32/Win64 only) returns 1 (true) if Omnis is running as a service |
| 204 | returns a list with a row for each function. The list has three columns: column 1 is the function group, column 2 is the function name and column 3 is the function description |
| 205 | returns the byte ordering of the hardware. True (1) for big-endian machines, false (0) for little-endian machines. |
| 209 | for macOS, returns the pathname of the folder containing the Omnis.app bundle, including the terminating path separator; this may be different to the pathname of the folder containing the Omnis executable (returned by sys(115)) if you are using Omnis as a bundle. For other platforms, returns the same pathname as sys(115). |
| 210 | returns the number of processors for the current machine (depending on the information reported by the operating system, the value may not reflect logical processor cores). |
| 212 |
returns the list of sort fields for the executing method stack. The list has the following columns: name - the name of the sort field descending - boolean, true if this field is sorted in descending order upper - boolean, true if sorting of this field is case-insensitive subtotals - boolean, true if subtotals are printed when the sort field changes newpage - boolean, true if a new page is started when the sort field changes |
| 215 |
returns the pathname of the folder containing the Omnis executable, including the terminating path separator. |
| 216 |
returns the pathname of the currently executing Omnis program. |
| 218 | modifies the OEM character conversion table to leave CR and LF unchanged. |
| 219 | restores the OEM character conversion table to the original mappings for CR and LF. |
| 228 | modifies the OEM character conversion table to leave TAB unchanged. |
| 229 | restores the OEM character conversion table to the original mapping for TAB. |
| 232 | (Win32/Win64 only) returns 1 (true) if Omnis is running as an elevated user or administrator. |
| 233 | (Windows and Linux only) returns the title of the main Omnis window. |
| 234 | returns a row containing statistics about RESTful requests to the Omnis server. The row has three columns:column 1 is the count of successful calls, column 2 is count of calls resulting in an error, and column 3 is the count of calls internally requeued because there was not a free user. |
| 235 | returns the value of the server configuration item timeOffsetMinutes in config.json. Omnis adds this to the current system date-time when generating the value for #D and #T. timeOffsetMinutes defaults to zero if it is not present in config.json. |
| 237 | if the method editor is the top window and a single method is selected, returns an item reference to the selected method; otherwise returns empty. |
| 238 | returns 1 (true) if the remote debug server is running. |
| 239 | returns 1 (true) if Omnis startup has finished. |
| 240 | returns a string that identifies the current monitor configuration. |
| 241 | returns a list which is a copy of the find and replace log. |
| 242 | returns a string which uniquely identifies the current child process when running in the Multi Process Server. If the current process is not a child process, returns 0. |
| 243 | returns true if Omnis is currently running as a Multi Process Server. |
| 250 | returns the list of files which were used to open Omnis, e.g. double-clicked from the Finder, or passed on the command line. This is empty if Omnis was opened directly by double-clicking. |
| 253 | returns true if Omnis is using dark mode. |
| 254 | returns the pathname of the folder where Omnis writes scripts and other files used to generate PDF documents. |
| 255 | returns the pathname of the folder where Omnis writes temporary PDF files. |
| 290 | returns the number of methods on the method stack excluding any that are to be cleared.This does not work for client requests running in a thread of the Multi-threaded Server. |
| 292 | returns an empty or single line list containing the same columns as sys(192) where the list line represents the calling method; the list is empty when there is no calling method. |
| 3000 | turn on logging of method command execution. |
| 3001 | turn off logging of method command execution. |
| 3003 | include method commands executed by IDE tasks in method command logging turned on using sys(3000). |
| 3004 | exclude method commands executed by IDE tasks from method command logging turned on using sys(3000). |
CalculatelPlatformassys(6)
IflPlatform='X'## on macOSDoFileOps.$createdir('HD/Omnis/Test')
Else IflPlatform='U'## on LinuxDoFileOps.$createdir('/home/omnis/test')
Else## on Windows platformsDoFileOps.$createdir('c:\Omnis\test')
End If