Delphi 2010 RTTI : Explore Enumerations

后端 未结 6 1927
挽巷
挽巷 2021-02-05 16:04

Considering such an enumeration :

type
  TTypeOfData = (
    [XmlName(\'ABC\')] todABC,
    [XmlName(\'DEF\')] todDEF,  
    [XmlName(\'GHI\')] todGHI
  );
         


        
6条回答
  •  爱一瞬间的悲伤
    2021-02-05 16:32

    I use and array of string in the const section:

    type
      TTypeOfData = (
        todABC,
        todDEF,  
        todGHI
      );
    
    const
      TypeOfDataText: array[TTypeOfData] of string = (
        'ABC',
        'DEF',
        'GHI'
      );
    

提交回复
热议问题