Home  |  Delphi .net Home  |  System.Enum  |  GetNames Method
  
GetNames  
Method  
Gets a list of the names of a specified enumeration type
Enum Class
System NameSpace
NotCF1.  Function GetNames ( EnumeratedType : Type ) : Array of String; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns an array of strings contaiing the names for the given EnumeratedType.
 
An enumeration is essentially a set of named constants. Each name is converted into a string and stored in the dynamically built returned array.
 
The names are sorted into the name numeric constant value sequence before being 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
  Names : Array of String;
  i     : Integer;

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

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

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