Platforms to show: All Mac Windows Linux Cross-Platform
Back to SystemInformationMBS module.
SystemInformationMBS.AvailableRAM as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
SystemInformationMBS.Computername as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
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
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 10.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
SystemInformationMBS.DomainName as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 10.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | All |
Returns an empty string on any error.
SystemInformationMBS.HardDiscSerial as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 10.3 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
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
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 10.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
SystemInformationMBS.LogicalRAM as Double Deprecated
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
On Windows the total virtual memory size.
On Linux always 4 GB.
In older plugins this function was named LogicalRAMMBS.
SystemInformationMBS.OSName as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Return values possible:
Windows NT
Windows 2000
Windows XP
Windows Vista
Mac OS
Mac OS X
Linux
and a few other Windows versions like 6.2 alias 8.
In older plugins this function was named OSNameMBS.
Some examples using this method:
SystemInformationMBS.OSVersionString as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GetOSVersionStr returns the version string of the OS.
Some Possible values:
"System 7.5.3",
"MacOS 8",
"MacOS 9.1",
"MacOS X 10.4.1",
"Windows NT 3.5",
"Windows 2000 (Service Pack 3)".
In older plugins this function was named OSVersionStrMBS.
On macOS Big Sur, this returns 11.x in Apple Silicon application and 10.6 in Intel application.
On macOS Monterey this returns 12.x.
If your Intel application is build with older SDK (e.g. Xojo 2019), the result reported version will still be macOS 10.16.
Some examples using this method:
SystemInformationMBS.PhysicalRAM as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
On old Windows versions some hundred KBs less for DOS.
Result changed from integer to double in plugin version 3.4 to return correct results on 2 GB RAM. In v5.2 changed to return correct values on Macs with more than 4 GB of RAM.
On Windows the total physical memory size.
In older plugins this function was named PhysicalRAMMBS.
Some examples using this method:
SystemInformationMBS.ProcessorCount(Mode as Integer = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
With plugin version 18.0, we added mode parameter. Pass 2 for physical CPU (kProcessorCountPhysical) and 1 for logical CPU count (kProcessorCountLogical) on Mac/Win.
On Windows or Mac OS the number of cores.
On Linux the number of configured CPUs.
Returns 1 on any error.
SystemInformationMBS.ShortUsername as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
On Linux and Mac OS X the short user name.
On all other cases the same as UserName function.
SystemInformationMBS.SystemFont as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
On Windows the system function returns "System" for our tests. Please tell us if this function is not working for you correct on Windows.
On Linux something like "Sans 10" is returned.
In older plugins this function was named SystemFontMBS.
SystemInformationMBS.Username as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | System | MBS Util Plugin | 8.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Code for Multiple User on Mac OS 9 is build in, but I can't test it.
This is tried on Mac OS:
1. Mac OS X Username function.
2. AppleEvent to FileSharing.
3. Multiple User Username (Mac OS 9)
4. System username from system resource.
In older plugins this function was named UserNameMBS.
The items on this page are in the following plugins: MBS Util Plugin.