摘要:
uses TypInfo;{以 TAlign 为例}procedure TForm1.Button1Click(Sender: TObject);var enum: TAlign; i: Integer; str: string;begin Memo1.Clear; for enum := Low(TAlign) to High(TAlign) do begin i := ord(enum); //Integer(enum) str := GetEnumName(TypeInfo(TAlign), i); Memo1.Lines.Add(Format('%d : %s', [i 阅读全文
摘要:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); end;var Form1: TForm1;implementation{$R *.dfm}uses RegularExpressions, msxml;const 阅读全文
摘要:
TRegExOption = ( roNone, //无 roIgnoreCase, //不区分大小写 roMultiLine, //多行模式; 可使 ^ 和 $ 匹配每个行首或行尾 roExplicitCapture, //只捕获指定了名称或编号的子表达式 roCompiled, //预编译表达式; 这在反复使用更有效率 roSingleLine, //单行模式; 使 . 也可匹配换行符 roIgnorePatternSpace //忽略注释和未经转义的空白);uses RegularExpressions;{roIgnoreCase}procedure TForm1.Button1Clic 阅读全文