码迷,mamicode.com
首页 > 其他好文 > 详细

xe6输出枚举类型每项字符串

时间:2014-08-11 02:43:01      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   os   io   for   

 1 unit Unit1;
 2 
 3 interface
 4 
 5 uses
 6   Winapi.Windows,
 7   Winapi.Messages,
 8   System.SysUtils,
 9   System.Variants,
10   System.Classes,
11   Vcl.Graphics,
12   Vcl.Controls,
13   Vcl.Forms,
14   Vcl.Dialogs,
15   Vcl.StdCtrls,
16   codesitelogging,
17   TypInfo;
18 
19 type
20   TForm1 = class(TForm)
21     Button1: TButton;
22     procedure Button1Click(Sender: TObject);
23   private
24     { Private declarations }
25   public
26     { Public declarations }
27   end;
28 
29 var
30   Form1: TForm1;
31 
32 implementation
33 
34 {$R *.dfm}
35 
36 type
37   TWindowsVersion = (wvUnknown, wvWin95, wvWin95OSR2, wvWin98, wvWin98SE, wvWinME, wvWinNT31, wvWinNT35, wvWinNT351,
38     wvWinNT4, wvWin2000, wvWinXP, wvWin2003, wvWinXP64, wvWin2003R2, wvWinVista, wvWinServer2008, wvWin7,
39     wvWinServer2008R2, wvWin8, wvWin8RT, wvWinServer2012, wvWin81, wvWin81RT, wvWinServer2012R2);
40 
41 procedure TForm1.Button1Click(Sender: TObject);
42 var
43   m_WindowsVersion: TWindowsVersion;
44   m_Str:            string;
45   I:                Integer;
46 begin
47   for I := 0 to 24 do
48   begin
49     m_Str := GetEnumName(TypeInfo(TWindowsVersion), I);
50     CodeSite.Send(Format(TWindowsVersion成员[%d]名字为  %s:,[ I,m_Str]));
51   end;
52 end;
53 
54 end.

bubuko.com,布布扣

xe6输出枚举类型每项字符串,布布扣,bubuko.com

xe6输出枚举类型每项字符串

标签:des   style   blog   http   color   os   io   for   

原文地址:http://www.cnblogs.com/GodPan/p/3903692.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!