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

 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.

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

时间: 2024-08-01 22:35:57

xe6输出枚举类型每项字符串的相关文章

输出枚举类型的值(seqmentation fault)

vim enum.c gcc -DD enum.c ./a.out 编译后发现执行到 24 行报错. 添加代码用于输出枚举值:

结构体、枚举类型——8月3日

一.结构体.美剧类型都是属于值类型 (一)结构体 就是一个自定义集合,里面可以放各种类型的元素,用法大体跟集合一样. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections;//下面要用到ArrayList集合,就要先引用这个 namespace 结构体_枚举类型 { cl

C#语言基础——结构体和枚举类型

结构体和枚举类型 一.结构体(struct) 结构类型是用户自己定义的一种类型,它是由其他类型组合而成的,可包含构造函数.常数.字段.方法.属性.索引器.运算符.事件和嵌套类型的值类型.结构在几个重要方面不同于类:结构为值类型而不是引用类型,并且结构不支持继承. 用结构的主要思想是用于创建小型的对象,如Point和FileInfo等等.这可以节省内存,因为没有如类对象所需的那样有额外的引用产生.例如,当声明含有成千上万个对象的数组时,这会引起极大的差异. 结构体是一个变量组,将一组变量放在一起,

C#枚举类型和结构体

注意:枚举类型和结构体都属于值类型. 结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的方法: struct student { public int nianling; public int fenshu; public string name; public string sex; public int sum; } 以上的语句就是定义一个名称为student的结构体,其中包含int类型的年龄.分数.总和,和string类型的姓名.性别. 二.用法: 在

结构体,枚举类型

结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的方法: struct student { public int nianling; public int fenshu; public string name; public string sex; public int sum; } 以上的语句就是定义一个名称为student的结构体,其中包含int类型的年龄.分数.总和,和string类型的姓名.性别. 二.用法: 在main主函数外面定义了一个名称为st

结构体与枚举类型

结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的方法: struct student { public int nianling; public int fenshu; public string name; public string sex; public int sum; } 以上的语句就是定义一个名称为student的结构体,其中包含int类型的年龄.分数.总和,和string类型的姓名.性别. 二.用法: 在main主函数外面定义了一个名称为st

Delphi的枚举类型

参考:http://blog.csdn.net/kissdeath/article/details/2060573 Delphi程序不仅可以用于数值处理,还更广泛的用于处理非数值的数据.例如:性别.月份.星期几.颜色.单位名.学历.职业等. 1.枚举类型的定义 格式:type 枚举类型标识符 = (标识符1, 标识符2, ..., 标识符n) 2.枚举类型数据特点 1)枚举元素只能是标识符 例如,下面的定义是合法的 type days = (sun, mon, tue, wed, thu, fr

DELPHI中枚举类型数据的介绍和使用方法

在看delphi程序的时候看到aa=(a,b,c,d);这样的东西,还以为是数组,同事说是函数,呵呵,当然这两个都不屑一击,原来这样式子是在声明并付值一个枚举类型的数据.下边写下来DELPHI中枚举类型数据的介绍和使用方法.见笑..------------------------------------------------------枚举类型 Pascal程序不仅用于数值处理,还更广泛地用于处理非数值的数据.例如,性别.月份.星期几.颜色.单位名.学历.职业等.1.枚举类型的定义格式: ty

asp.net MVC 枚举类型的处理的几种方式

1.基架自动生成@Html.EnumDropDownListFor()辅助方法映射到模型类属性的元数据. @model MajorConstruction.Models.Course <div class="form-group"> @Html.LabelFor(model => model.CourseType, htmlAttributes: new { @class = "control-label col-md-2" }) <div