i = getos(ʃdetailed_informationʅ);
The
getos function returns a code that indicates what operating system is running the program. The codes are:
| Code | Operating System |
| 10 | Windows |
| 20 | Android |
It is also possible to get more detailed information about the operating system. If the optional argument
detailed_information is a
string variable, the string will be filled with the operating system name and the version number. Alternatively, if passed a one-dimensional string
HashMap, the HashMap will be filled with several values:
| Key | Value |
| "name" | Name (e.g., "Windows") |
| "version" | Version number (e.g., "10.0") |
| "build" | Build number (Windows only; e.g., "22000") |
Windows version numbers do not necessarily match the official release numbers. For example, Windows 8.1 has a version number of 6.3.
The function returns the operating system code and, optionally, more details about the operating system.
string operating_system_name;
getos(operating_system_name);
errmsg("Code = %d, Text = %s", getos(), operating_system_name);
// the above code might display, for example:
// Code = 10, Text = Windows;6.1
// Code = 20, Text = Android;4.2.2