Home  |  Delphi .net Home  |  System.Enum  |  GetValues Method
  
GetValues  
Method  
Gets a list of the names of a specified enumeration type
Enum Class
System NameSpace
NotCF1.  Function GetValues ( EnumerationType : Type ) : System.Array; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
The names of the given EnumerationType are retrieved into a new System.Array object.
 
They are sorted into the name numeric constant value sequence before being returned.
Notes
Important : unlike the GetNames method, the returned array is not a primitive array - it is a .Net array : System.Array.
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
  Names : System.Array;
  i     : Integer;

begin
  // Get the list of enumeration names
  Names := System.Enum.GetValues(TypeOf(System.DayOfWeek));

  // Display the list
  for i := 0 to Names.Length-1 do
    Console.WriteLine(Names.GetValue(i));

  Console.ReadLine;
end.
   Sunday
   Monday
   Tuesday
   Wednesday
   Thursday
   Friday
   Saturday
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author