自定义类型,如何调用取值?
type
TSuit = (Club, Diamond, Heart, Spade);
var
ASuit: TSuit;
procedure TForm15.Button1Click(Sender: TObject);
var
I: Integer;
begin
for ASuit := Club to Spade do
ShowMessage(这咋写?);
end;
ShowMessage(GetEnumName(TypeInfo(TSuit), Ord(ASuit))); lies2014 发表于 2024-10-31 00:30
ShowMessage(GetEnumName(TypeInfo(TSuit), Ord(ASuit)));
需要加上
uses
TypInfo;
页:
[1]