Tips   >   Functions   >   Sys Functions - Hardware

Sys Functions - Hardware

This section provides you with documentation, tips, and demos for each of hardware related the sys() functions.

sys(6) Platform code

Returns the platform code of the current executable:

sys(7) OS Version #

Returns a string containing the version number of the current OS.

For example, returns "3.11" under Windows for Workgroups version 3.11, "4.0" under Windows 95, and "7.5" when running under the MacOS System Software 7.5.

sys(8) Omnis platform type

Returns the platform type of the current Omnis program as a string: 'MAC600', 'WIN32',’UNIX’,’SOLARIS’

sys(87) Horiz screen res

Returns horizontal screen resolution in pixels per inch

sys(88) Vert screen res

Returns vertical screen resolution in pixels per inch

sys(101) Printer name

Returns the current printer name, and network path (empty if not connected).

This is useful to put in your Startup_Task method. If the user doesn't have a printer selected, it can take you quite a while to figure this out what the problem is when the call to say "none of my reports will print", or "my application crashes every time I try to print a report".

; Test to make sure the user has selected a printer.
If sys(101)=''&sys(6)<>'U' ;; Test for selected printer.
   OK message [sys(85)] (Icon,Sound bell) {You currently do not have a printer selected.////Reports will not run until you select a printer.}
End If

sys(104) Screen width

Returns the screen width in pixels.

sys(105) Screen height

Returns the screen height in pixels.

sys(106) App heap size

MacOS Classic: returns the application heap size in bytes.
Mac OS X: not relevant - returns a fixed large value.
Other platforms: returns the size in bytes of available physical memory.

sys(107) App free memory

MacOS Classic: returns the current free memory in bytes in the application heap after adding memory used for discardable objects.
Mac OS X: not relevant - returns a fixed large value.
Other platforms: returns the total size in bytes of physical memory.

sys(108) Free memory

MacOS Classic: returns the current free memory in bytes in the application heap without adding memory used for discardable objects.
Mac OS X: not relevant - returns a fixed large value.
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.

sys(109) Unused memory

Returns the unused memory in bytes. On Windows and Unix, this is the number of bytes available in the paging file, added to the number of bytes of available physical memory.

sys(110) CPU type

Returns the CPU type for PCs, Macs, and compatibles.

For PC:
3 = 80386,
4 = 80486
5 = Pentium

For PC:
3 = 68030
4 = 68040.

For PowerMac:
257 = PowerPC 601
259 = PowerPC 603
260 = PowerPC 604
262 = PowerPC 603e
263 = PowerPC 603ev
264 = PowerPC 750 & G3
265 = PowerPC 604e
266 = PowerPC 604ev
268 = G4
313 = G5

sys(111) Apple ROM version

(MacOS only) returns the Apple ROM version: 121 = SI, 124 = IIsi, CI & FX.

sys(112) Balloon help

(MacOS only) returns 1 (true) if balloon help is available, 0 otherwise.

Since the Mac OS X version of Omnis does not support balloon help, the return value is always zero on Mac OS X.

sys(113) Publish and Subscribe

(MacOS only) returns 1 (true) if Publish and Subscribe is available, 0 otherwise.

Since the Mac OS X version of Omnis does not support Publish and Subscribe, the return value is always zero on Mac OS X.

sys(114) Apple events

(MacOS only) returns 1 (true) if Apple events are available, 0 otherwise.

sys(115) Omnis App pathname

On all platforms except Windows Vista returns the pathname of the folder containing the Omnis executable, including the terminating path separator.
On Windows Vista returns the pathname of the folder containing the installed writeable files, including the terminating path separator (usually a sub-folder of the AppData Local folder). To get the pathame of the folder containing the Omnis executable, use sys(215).

sys(116) Linux lowercase filenames

(Linux only) returns 1 (true) if Omnis has been configured to force all file names to be lower case, 0 otherwise.

sys(118) Windows OS information

(Windows only) returns additional information about the operating system version.

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).

sys(120) Windows dialog width

(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.

sys(121) Windows dialog height

(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.

sys(197) Windows XP Themes

Returns true (1) if running on Windows XP with themes enabled, false (0) if not.

sys(203) Win32 Omnis as Service

(Win32 only) returns 1 (true) if Omnis is running as a service.

sys(209) App Bundle Folder

(Mac OS X) 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).

sys(215) Omnis Executable pathname

Returns the pathname of the folder containing the Omnis executable, including the terminating path separator.