Tips   >   Functions   >   Sys Functions
The sys() functions are great, but getting at the list of them through is a bit of a hassle.
This section provides you with documentation, tips, and demos for each of the sys() functions.
Also included are some undocumented sys() functions. See the bottom of the list.
Syntax: sys(number)
Returns information about the current system depending on a number argument.
Using the sys() functions, you can obtain system information such as the current printer name, the pathname of the current library, the screen width or height in pixels, etc.Returns the Omnis program type byte:
Returns the pathname separator for the current platform:
Returns the pathname of the current library file.
You can also use notation: $clib().$pathnameReturns the name of the installed user-defined menu(s) starting from the left-most menu (empty if none are installed).
You can also use notation to make a list of all the installed menus.
; Make a list of all the installed menus.
Do $imenus.$makelist($ref().$name) Returns List
Returns the name of the open user-defined window(s) starting with the top window (empty if none are open).
You can use notation to make a list of all the open windows.
; Make a list of all the open windows.
Do $iwindows.$makelist($ref().$name,$ref.$title) Returns List
Returns the name of currently executing method in the form ClassName/MethodName.
You can not pass sys(185) as a square bracket parameter. It will continue to evaluate/change to the next currently executing method. You can't freeze sys(85) and pass it.
The solution I found was to pass $cmethod, receive it as an item reference parameter, and then evaluate the reference. (e.g. prMethod.$class().$name)
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.
You can use sys(90) at the beginning of a timer object method, to prevent it from interrupting other methods.
; Check if there are any other method running before running the timer method.
If sys(90)>1
; Do nothing
Else
; Run the timer triggered method/code.
End If
Returns the name of currently executing method in the format:
Library name.class name/method name/Line number
You can not pass sys(185) as a square bracket parameter. It will continue to evaluate/change to the next currently executing method. You can't freeze sys(185) and pass it.
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.The sys(192) function 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:
Returns the contents of the trace log to a list. Available in both runtime and design mode. Useful for debugging runtime problems.
Send to trace log has an option, Diagnostic message. When this option is checked, the message will only be logged if the trace log is set to Log diagnostic messages. See for more information.Generates a list of open window in the IDE. The list has columns as follows:
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 objectReturns the list of all open libraries (including private libraries) and their VCS build properties. The list has the following columns:
Returns a list with a row for each method command. The list has two columns:
Returns a list with a row for each function. The list has three columns:
Returns the list of sort fields for the executing method stack. The list has the following columns:
The first time you issue a sys(3000) during a session of Omnis Studio, Omnis creates a sequential log file that is named SEQLOG#.TXT, where # is a number. The file is created in the sys(115) directory. Each time you quit and restart Omnis Studio, the next time you issue a sys(3000) Omnis Studio will start a new trace log file. The file name will have the next sequential number appended to it. e.g. SEQLOGO.TXT, SEQLOGO1.TXT, SEQLOGO2.TXT
Omnis Studio then writes the trace log messages to that file.
The first time you issue a sys(3001) during a session of Omnis Studio, Omnis give you an OK message telling you the trace log file name. Subsquent uses of sys(3001) during the same session of Omnis Studio do not trigger the OK message.
The sys(3000) function is very useful thing if you have a procedure that crashes Omnis Studio. By issuing sys(3000) and then running the code which causes Omnis Studio to crash, you can then open the trace log file and get some hints as to when in your methods the crash is occurring.
If you delete the file with Omnis Studio still open and try to issue a sys(3000), Omnis will inform you that it can't find the file. Only delete the file after you quit Omnis Studio. To clear the trace file, open the file, select and delete all text and then close the file.
The Send to trace log method does not work for sending text to the sys(3000) file trace log.
Stop trace to file.
See for more information.Loop through the sys functions. It's interesting what you can find out when you put sys(#) in a loop. :-)
; Loop through all the sys() functions.
For Num from 1 to 5000 step 1
If len(sys(Num))>0
Yes/No message Loop through sys() functions (Icon) {////sys([Num]) = [sys(Num)]////////Continue?}
If flag false
Break to end of loop
End If
End If
End For
Quit method kTrue