Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Enum type and helper function? (https://www.delphipraxis.net/193453-enum-type-helper-function.html)

WojTec 2. Aug 2017 10:42

Delphi-Version: XE6

Enum type and helper function?
 
I have enum type:

Delphi-Quellcode:
type
  TCpuArch = (IntelX86, IntelX64);

and I want to TCpuArch.ToString method for it. How can I add it to enum?

jaenicke 2. Aug 2017 10:53

AW: Enum type and helper function?
 
This way (starting with XE3):
Delphi-Quellcode:
  TCpuArchHelper = record helper for TCpuArch
    function ToString: string;
  end;

WojTec 2. Aug 2017 11:29

Re: Enum type and helper function?
 
I thought this can be added inside type. Ok, thanks! :)

freimatz 4. Aug 2017 15:30

AW: Enum type and helper function?
 
Juhu. Und für sets gehts auch :-D


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz