Home  |  Delphi .net Home  |  System.Version  |  Equals Method
  
Equals  
Method  
Compares a Version value to the current Version value
Version Class
System NameSpace
CF1.  Function Equals ( Value : Version ) : Boolean;
CF : Methods with this mark are Compact Framework Compatible
Description
Compares the current (Source) Version value with the Target value.
 
It returns true if they are the same, or false if not the same or Value is null.
Microsoft MSDN Links
System
System.Version
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

var
  ver1, ver2 : Version;
  result     : Integer;

begin
  // Fabricate a version number
  ver1 := Version.Create('1.2.3.4');

  // Get the current Operating System version
  ver2 := Environment.OSVersion.Version;

  Console.WriteLine('ver1 = ' + ver1.ToString);
  Console.WriteLine('ver2 = ' + ver2.ToString);

  // Compare ver1 to ver2
  if ver1.Equals(ver2)
  then Console.WriteLine('ver1  = ver2')
  else Console.WriteLine('ver1 <> ver2');

  Console.ReadLine;
end.
   ver1 = 1.2.3.4
   ver2 = 5.1.2600.0
   ver1 <> ver2
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author