Platforms to show: All Mac Windows Linux Cross-Platform
Back to SystemInformationMBS module.
SystemInformationMBS.AvailableRAM as Double
Function:
Returns the size of the available memory.
Example:
Notes:
This function is useful if you want to know how much memory you can allocate without the system swapping.
On Windows, Mac OS X and Linux you can normally allocate up to 2 or 3 GB of memory in your addressroom. A swap file on disc is used to cache memory which does not fit into physical memory.
So if you need to allocate a buffer to store temporary data, you can use this function to calculate a good size.
For example a file copy function could use something like this:
// a quarter of free memory is good to leave room for some OS buffers:
buffersize=SystemInformationMBS.AvailableRAM/4
// minimum 4 MB
if buffersize<1024*1024*4 then
buffersize<1024*1024*4
end if
// maximum 128 MB to make chunks not too big and application too unresponsible
if buffersize<1024*1024*128 then
buffersize<1024*1024*128
end if
In older plugins this function was named AvailableRAMMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
msgBox format(SystemInformationMBS.AvailableRAM/1024/1024,"0")+" MB of RAM free."
This function is useful if you want to know how much memory you can allocate without the system swapping.
On Windows, Mac OS X and Linux you can normally allocate up to 2 or 3 GB of memory in your addressroom. A swap file on disc is used to cache memory which does not fit into physical memory.
So if you need to allocate a buffer to store temporary data, you can use this function to calculate a good size.
For example a file copy function could use something like this:
// a quarter of free memory is good to leave room for some OS buffers:
buffersize=SystemInformationMBS.AvailableRAM/4
// minimum 4 MB
if buffersize<1024*1024*4 then
buffersize<1024*1024*4
end if
// maximum 128 MB to make chunks not too big and application too unresponsible
if buffersize<1024*1024*128 then
buffersize<1024*1024*128
end if
In older plugins this function was named AvailableRAMMBS.
Some examples using this method:
SystemInformationMBS.BusSpeed as Double
Function:
Returns the speed of the System bus in Hz.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Example:
msgbox "Your main CPU has "+format(SystemInformationMBS.BusSpeed/1000000.0,"0")+" MHz"
SystemInformationMBS.Computername as string
Function:
Returns the name of the computer.
Example:
Notes:
On Mac OS, the name is queried in this order:
1. Try to ask the Mac OS X Corefoundation for the name.
2. Try to ask via AppleEvents the Finder or FileSharing.
3. Read it from the system resources.
On Linux or Windows the system name.
In older plugins this function was named ComputerNameMBS.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox "Hi, I'm "+SystemInformationMBS.Computername+"."
On Mac OS, the name is queried in this order:
1. Try to ask the Mac OS X Corefoundation for the name.
2. Try to ask via AppleEvents the Finder or FileSharing.
3. Read it from the system resources.
On Linux or Windows the system name.
In older plugins this function was named ComputerNameMBS.
SystemInformationMBS.CPUBrandString as string
Function:
Returns the CPU brand string.
Example:
Notes:
If it is an Intel x86 Chip or something compatible, you get strings like this: "Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz" (Same as CPUIDMBS.BrandString). But on PowerPC chips we return strings like "PowerPC G5 (970MP)" (same as CPUInfoMBS.CPUName).
May return "" if the processor is unknown.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 10.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
MsgBox SystemInformationMBS.CPUBrandString
If it is an Intel x86 Chip or something compatible, you get strings like this: "Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz" (Same as CPUIDMBS.BrandString). But on PowerPC chips we return strings like "PowerPC G5 (970MP)" (same as CPUInfoMBS.CPUName).
May return "" if the processor is unknown.
Some examples using this method:
SystemInformationMBS.CPUSpeed as Double
Function:
Returns the Speed of the main CPU in Hz.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
msgbox "Your main CPU has "+format(SystemInformationMBS.CPUSpeed/1000000.0,"0")+" MHz"
SystemInformationMBS.DomainName as string
Function:
Returns the domain name of a Windows PC.
Example:
Notes:
Returns an empty string on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 10.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Example:
msgbox SystemInformationMBS.DomainName
SystemInformationMBS.HardDiscSerial as string
Function:
Returns the hard disc serial number of the first hard disc which has a serial number.
Example:
Notes:
This function can return "" if nothing is found.
Seems to return always empty string on Mac OS X 10.4 as the system properties dictionary does not contain the serial number there.
On Windows this function sometimes returns empty string, but later works again on the same machine. Reason unknown.
In Windows 8.1 it looks like WindowsWMIMBS.InitSecurity(false) must be called at app.open time as Xojo will do some things in background when opening first window which block our queries.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 10.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
Example:
MsgBox SystemInformationMBS.HardDiscSerial
This function can return "" if nothing is found.
Seems to return always empty string on Mac OS X 10.4 as the system properties dictionary does not contain the serial number there.
On Windows this function sometimes returns empty string, but later works again on the same machine. Reason unknown.
In Windows 8.1 it looks like WindowsWMIMBS.InitSecurity(false) must be called at app.open time as Xojo will do some things in background when opening first window which block our queries.
Some examples using this method:
SystemInformationMBS.HostName as string
Function:
Returns the hostname for this computer.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 10.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
MsgBox SystemInformationMBS.HostName
SystemInformationMBS.Is64bitWindows as boolean
Function:
Whether the Windows you are using is a 64-bit Windows.
Example:
Notes:
Returns true for x64 Windows editions for 32-bit applications.
This function could also be named isWoW64 for "is Windows on Windows 64 bit."
Only for Intel CPU.
Will return false if used on ARM CPU.
Returns always true on 64bit target.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 9.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox str(SystemInformationMBS.Is64bitWindows)
Returns true for x64 Windows editions for 32-bit applications.
This function could also be named isWoW64 for "is Windows on Windows 64 bit."
Only for Intel CPU.
Will return false if used on ARM CPU.
Returns always true on 64bit target.
Some examples using this method:
SystemInformationMBS.isARM as Boolean
Function:
Checks whether CPU is ARM.
Example:
Notes:
Returns true for:
Returns false for x86 CPUs, e.g. MacOS as well as iOS/Android in simulator.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 20.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
If TargetMacOS Then
If SystemInformationMBS.isARM Then
MsgBox "Running ARM version on ARM CPU."
Elseif SystemInformationMBS.IsTranslated Then
MsgBox "Running Intel version on ARM CPU."
Else
MsgBox "Running Intel version on Intel CPU."
End If
End If
Returns true for:
- Raspberry Pi for Linux ARM
- iOS or Android on device.
- Apple Silicon Mac
Returns false for x86 CPUs, e.g. MacOS as well as iOS/Android in simulator.
SystemInformationMBS.isBigSur(orHigher as boolean = true) as boolean
Function:
Whether the operation system is macOS 11 Big Sur or newer.
Notes: Returns 1 if this is Big Sur or newer, otherwise 0.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: Returns 1 if this is Big Sur or newer, otherwise 0.
SystemInformationMBS.isCatalina(orHigher as boolean = true) as boolean
Function:
Whether the operation system is MacOS 10.15 Catalina or newer.
Example:
Notes:
Returns true on MacOS 10.15 or newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 19.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isMojave)
SystemInformationMBS.isElCapitan(orHigher as boolean = true) as boolean
Function:
Whether the operation system is Mac OS X 10.11 El Capitan or newer.
Example:
Notes:
Returns true on Mac OS X 10.11.
If orHigher is set, it will also return true on 10.12.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 15.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isElCapitan)
Returns true on Mac OS X 10.11.
If orHigher is set, it will also return true on 10.12.
Some examples using this method:
SystemInformationMBS.isHighSierra(orHigher as boolean = true) as boolean
Function:
Whether the operation system is macOS 10.13 High Sierra or newer.
Example:
Notes:
Returns true on Mac OS X 10.13.
If orHigher is set, it will also return true on 10.14.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 18.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isHighSierra)
Returns true on Mac OS X 10.13.
If orHigher is set, it will also return true on 10.14.
SystemInformationMBS.isLeopard(orHigher as boolean = true) as boolean Deprecated
Function:
Whether the operation system is Mac OS X 10.5 Leopard or newer.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 9.6 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isLeopard)
This item is deprecated and should no longer be used.
Notes:
Returns true on Mac OS X 10.5 or newer.
SystemInformationMBS.isLion(orHigher as boolean = true) as boolean Deprecated
Function:
Whether the operation system is Mac OS X 10.7 Lion or newer.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isLion)
This item is deprecated and should no longer be used.
Notes:
Returns true on Mac OS X 10.7 or newer.
SystemInformationMBS.isMacOSX as Boolean
Function:
Returns true if being called on Mac OS X.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 8.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
msgbox str(SystemInformationMBS.isMacOSX)
Some examples using this method:
SystemInformationMBS.isMavericks(orHigher as boolean = true) as boolean
Function:
Whether the operation system is Mac OS X 10.9 Mavericks or newer.
Example:
Notes:
Returns true on Mac OS X 10.9 or newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 13.2 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isMavericks)
Some examples using this method:
SystemInformationMBS.isMojave(orHigher as boolean = true) as boolean
Function:
Whether the operation system is MacOS 10.14 Mojave or newer.
Example:
Notes:
Returns true on MacOS 10.14 or newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 18.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isMojave)
Some examples using this method:
SystemInformationMBS.isMonterey(orHigher as boolean = true) as boolean
Function:
Whether the operation system is macOS 12 Monterey or newer.
Notes: Returns 1 if this is Monterey or newer, otherwise 0.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 21.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: Returns 1 if this is Monterey or newer, otherwise 0.
SystemInformationMBS.isMountainLion(orHigher as boolean = true) as boolean Deprecated
Function:
Whether the operation system is Mac OS X 10.8 Mountain Lion or newer.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isMountainLion)
This item is deprecated and should no longer be used.
Notes:
Returns true on Mac OS X 10.8 or newer.
SystemInformationMBS.isSierra(orHigher as boolean = true) as boolean
Function:
Whether the operation system is macOS 10.12 Sierra or newer.
Example:
Notes:
Returns true on Mac OS X 10.12.
If orHigher is set, it will also return true on 10.13.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 16.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isSierra)
Returns true on Mac OS X 10.12.
If orHigher is set, it will also return true on 10.13.
SystemInformationMBS.isSnowLeopard(orHigher as boolean = true) as boolean Deprecated
Function:
Whether the operation system is Mac OS X 10.6 Snow Leopard or newer.
Example:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 9.6 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
MsgBox str(SystemInformationMBS.isSnowLeopard)
This item is deprecated and should no longer be used.
Notes:
Returns true on Mac OS X 10.6 or newer.
SystemInformationMBS.IsTranslated as Integer
Function:
Queries whether application is translated on Apple Silicon Macs.
Example:
Notes:
Returns 1 if Intel code gots translated to ARM code.
Returns 0 for a native ARM application.
Returns -1 if unknown.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 20.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
If TargetMacOS Then
If SystemInformationMBS.isARM Then
MsgBox "Running ARM version on ARM CPU."
Elseif SystemInformationMBS.IsTranslated Then
MsgBox "Running Intel version on ARM CPU."
Else
MsgBox "Running Intel version on Intel CPU."
End If
End If
Returns 1 if Intel code gots translated to ARM code.
Returns 0 for a native ARM application.
Returns -1 if unknown.
SystemInformationMBS.isVentura(orHigher as boolean = true) as boolean
Function:
Whether the operation system is macOS 13 Ventura or newer.
Notes: Returns 1 if this is Ventura or newer, otherwise 0.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 22.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Notes: Returns 1 if this is Ventura or newer, otherwise 0.
SystemInformationMBS.isWindows10(orHigher as boolean = false) as Boolean
Function:
Returns true if called on Windows 10.
Example:
Notes:
And False on Mac OS, Linux, Windows 7/Vista/XP/2000/ME/98/95/8/8.1.
If orHigher, than it returns true if OS Version is newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox str(SystemInformationMBS.isWindows10)
And False on Mac OS, Linux, Windows 7/Vista/XP/2000/ME/98/95/8/8.1.
If orHigher, than it returns true if OS Version is newer.
Some examples using this method:
SystemInformationMBS.isWindows11(orHigher as boolean = false) as Boolean
Function:
Returns true if called on Windows 11.
Example:
Notes:
And False on Mac OS, Linux, Windows 7/Vista/XP/2000/ME/98/95/8/8.1/10.
If orHigher, than it returns true if OS Version is newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 21.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox str(SystemInformationMBS.isWindows11)
And False on Mac OS, Linux, Windows 7/Vista/XP/2000/ME/98/95/8/8.1/10.
If orHigher, than it returns true if OS Version is newer.
SystemInformationMBS.isWindows2000(orHigher as boolean = false) as Boolean Deprecated
Function:
Returns true if called on Windows 2000.
Example:
And False on Mac OS X, Linux, Windows 7/XP/Vista/ME/98/95.
If orHigher, than it returns true if OS Version is newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 8.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox str(SystemInformationMBS.isWindows2000)
This item is deprecated and should no longer be used.
Notes:
And False on Mac OS X, Linux, Windows 7/XP/Vista/ME/98/95.
If orHigher, than it returns true if OS Version is newer.
SystemInformationMBS.isWindows7(orHigher as boolean = false) as Boolean
Function:
Returns true if called on Windows 7.
Example:
Notes:
And False on Mac OS X, Linux, Windows Vista/XP/2000/ME/98/95.
If orHigher, than it returns true if OS Version is newer.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | System | MBS Util Plugin | 10.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Example:
msgbox str(SystemInformationMBS.isWindows7)
And False on Mac OS X, Linux, Windows Vista/XP/2000/ME/98/95.
If orHigher, than it returns true if OS Version is newer.
Some examples using this method:
The items on this page are in the following plugins: MBS Util Plugin.
