Show: Delphi C++
Display Preferences

System.SysUtils.TOSVersion

From XE3 API Documentation
Jump to: navigation, search

Delphi

  TOSVersion = record
  public type
    TArchitecture = (arIntelX86, arIntelX64);
    TPlatform = (pfWindows, pfMacOS);
  private
    class var FArchitecture: TArchitecture;
    class var FBuild: Integer;
    class var FMajor: Integer;
    class var FMinor: Integer;
    class var FName: string;
    class var FPlatform: TPlatform;
    class var FServicePackMajor: Integer;
    class var FServicePackMinor: Integer;
    class constructor Create;
  public
    class function Check(AMajor: Integer): Boolean; overload; static; inline;
    class function Check(AMajor, AMinor: Integer): Boolean; overload; static; inline;
    class function Check(AMajor, AMinor, AServicePackMajor: Integer): Boolean; overload; static; inline;
    class function ToString: string; static;
    class property Architecture: TArchitecture read FArchitecture;
    class property Build: Integer read FBuild;
    class property Major: Integer read FMajor;
    class property Minor: Integer read FMinor;
    class property Name: string read FName;
    class property Platform: TPlatform read FPlatform;
    class property ServicePackMajor: Integer read FServicePackMajor;
    class property ServicePackMinor: Integer read FServicePackMinor;
  end;

C++

struct DECLSPEC_DRECORD TOSVersion{
public:
    enum DECLSPEC_DENUM TArchitecture : unsigned char { arIntelX86, arIntelX64 };
    enum DECLSPEC_DENUM TPlatform : unsigned char { pfWindows, pfMacOS };
private:
    static TArchitecture FArchitecture;
    static int FBuild;
    static int FMajor;
    static int FMinor;
    static System::UnicodeString FName;
    static TPlatform FPlatform;
    static int FServicePackMajor;
    static int FServicePackMinor;
private:
public:
    static bool __fastcall Check(int AMajor)/* overload */;
    static bool __fastcall Check(int AMajor, int AMinor)/* overload */;
    static bool __fastcall Check(int AMajor, int AMinor, int AServicePackMajor)/* overload */;
    static System::UnicodeString __fastcall ToString();
    /* static */ __property TArchitecture Architecture = {read=FArchitecture};
    /* static */ __property int Build = {read=FBuild};
    /* static */ __property int Major = {read=FMajor};
    /* static */ __property int Minor = {read=FMinor};
    /* static */ __property System::UnicodeString Name = {read=FName};
    /* static */ __property TPlatform Platform = {read=FPlatform};
    /* static */ __property int ServicePackMajor = {read=FServicePackMajor};
    /* static */ __property int ServicePackMinor = {read=FServicePackMinor};
private:
};

Properties

Type Visibility Source Unit Parent
record
struct
public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils System.SysUtils

Description

Describes the current operating system: platform and version.

Use TOSVersion to get information about the current operating system, such as:

  • Platform (Windows or MAC OS X)
  • Version

Other information:

  • Architecture (Intel x86 or Intel x64)
  • Installed service pack

Example:

Writeln(TOSVersion.ToString);

Possible output:

Windows XP Service Pack 3 (Version 5.1, Build 2600, 32-bit Edition)

You cannot create TOSVersion variables. TOSVersion represents static (global) data initialized at application start-up.

TOSVersion provides methods to check the version of the operating system. See the overloads of Check.

See Also

Personal tools
Translations