Home  |  Delphi .net Home  |  System.Enum  |  Equals Method
  
Equals  
Method  
Determines if the current enum value equals another
Enum Class
System NameSpace
CF1.  Function Equals ( Target : Object ) : Boolean;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns true if the current Enum value matches the Target Enum value. Otherwise false.
Notes
If the Target object is null then false is returned.
Microsoft MSDN Links
System
System.Enum
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

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

var
  Day1, Day2 : System.Enum;

begin
  Day1 := DayOfWeek.Monday;
  Day2 := DayOfWeek.Friday;

  if Day1.Equals(Day2)
  then Console.WriteLine('{0}  = {1}', Day1.ToString, Day2.ToString)
  else Console.WriteLine('{0} <> {1}', Day1.ToString, Day2.ToString);

  if Day2.Equals(Day2)
  then Console.WriteLine('{0}  = {1}', Day2.ToString, Day2.ToString)
  else Console.WriteLine('{0} <> {1}', Day2.ToString, Day2.ToString);

  if Day2.Equals(Day1)
  then Console.WriteLine('{0}  = {1}', Day2.ToString, Day1.ToString)
  else Console.WriteLine('{0} <> {1}', Day2.ToString, Day1.ToString);

  Console.ReadLine;
end.
   Monday <> Friday
   Friday  = Friday
   Friday <> Monday
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author