OSVersion()
Syntax
Result = OSVersion()Description
Returns the version of the operating system on which the program has been launched.
Parameters
None.
Return value
Returns one of the following values, depending on the OS on which the command run:
WindowsLinux#PB_OS_Windows_NT3_51 #PB_OS_Windows_95 #PB_OS_Windows_NT_4 #PB_OS_Windows_98 #PB_OS_Windows_ME #PB_OS_Windows_2000 #PB_OS_Windows_XP #PB_OS_Windows_Server_2003 #PB_OS_Windows_Vista #PB_OS_Windows_Server_2008 #PB_OS_Windows_7 #PB_OS_Windows_Server_2008_R2 #PB_OS_Windows_8 #PB_OS_Windows_Server_2012 #PB_OS_Windows_8_1 #PB_OS_Windows_Server_2012_R2 #PB_OS_Windows_10 #PB_OS_Windows_Future ; New Windows version (not existing when the program was written)Mac OSX#PB_OS_Linux_2_2 #PB_OS_Linux_2_4 #PB_OS_Linux_2_6 #PB_OS_Linux_Future ; New Linux version (not existing when the program was written)#PB_OS_MacOSX_10_0 #PB_OS_MacOSX_10_1 #PB_OS_MacOSX_10_2 #PB_OS_MacOSX_10_3 #PB_OS_MacOSX_10_4 #PB_OS_MacOSX_10_5 #PB_OS_MacOSX_10_6 #PB_OS_MacOSX_10_7 #PB_OS_MacOSX_10_8 #PB_OS_MacOSX_10_9 #PB_OS_MacOSX_10_10 #PB_OS_MacOSX_10_11 #PB_OS_MacOSX_Future ; New MacOS X version (not existing when the program was written)
Example
Select OSVersion() Case #PB_OS_Windows_98 MessageRequester("Info", "Windows 98") Case #PB_OS_Windows_2000 MessageRequester("Info", "Windows 2000") Case #PB_OS_Windows_XP MessageRequester("Info", "Windows XP") Default MessageRequester("Info", "Unsupported Windows version") EndSelectNote: the value of these constants are established before the release date of each version, therefore tests such as the one which follows, may be used, in order to catch all versions which are older or newer than a given one:If OSVersion() < #PB_OS_Windows_2000 ; ; All versions older than Windows 2000 ; EndIf
Supported OS
All