On Thu, 22 Dec 2022, Andrew Haines via fpc-pascal wrote:
Hi what I want to do is similar to this question here:
https://en.delphipraxis.net/topic/423-rtti-determine-record-helper-type-for-a-base-type/
I am going to create multiple type helpers for enums and I would like to look
up the help
So, I came up with a solution using Custom Attributes.
I can declare this:
[TEnumAttr('YES', 'NO', 'COULD_BE')]
TMyEnum = (meYes, meNo, meCouldBe);
and at runtime look for the TEnumAttr attribute and use that.
TEnumAttr = class(TCustomAttribute)
protected
FValues: TStringArray;
FT
Hi what I want to do is similar to this question here:
https://en.delphipraxis.net/topic/423-rtti-determine-record-helper-type-for-a-base-type/
I am going to create multiple type helpers for enums and I would like to
look up the helper and use common methods AsString AsOrdinal to get/set
the v