What operating system?

What code is there to find the operating system of a user?
This is simple… I really should look myself, but I don’t know wat to look for!

I haved tried operating system, windows, mac, linux… But all these words have a wide meaning in the Docs! :-))

There’s code floating around the forum to do it.
However, you won’t be able to discern Windows 8, 8.1, and 10 without editing the manifest or using plugins.

This search has both mac and windows solutions:
https://www.google.com/search?hl=en&q=site:forum.xojo.com+system+version

If you have MBS Complete, there is a class that reports the system for all OSes, and I remember it makes the difference between 8, 8.1 and 10. Forgot the name. Christian will probably chime in.

There is also usually a shell command, like Ver for Windows or sw_vers for Mac.

And for high-level OS identification, use the compiler constants: TargetWindows, TargetMacOS, TargetLinux.

SystemInformationMBS module
http://www.monkeybreadsoftware.net/module-systeminformationmbs.shtml

but normally if you just want to know whether Windows or Mac, you can use #if with target constants.

I use a function named Platform that returns a string

Sub Platform As String
#if TargetLinux
  Return "Linux"
#elseif TargetMacOS
  Return "OS X"
#else
  Return "Windows"
#endif

or define a global dynamic constant and set the Windows instance to Windows, etc
you can even then set it to specific values for specific languages you support

very handy