Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Ondrej Pokorny via fpc-pascal
On 23.12.2022 15:50, Andrew Haines via fpc-pascal wrote: On 12/23/22 5:24 AM, Ondrej Pokorny via fpc-pascal wrote: This may be simpler: [TEnumAttr(['YES', 'NO', 'COULD_BE'])]   TMyEnum = (meYes, meNo, meCouldBe); TEnumAttr = class(TCustomAttribute)   protected     FValues: TStringArray;    

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Michael Van Canneyt via fpc-pascal
On Fri, 23 Dec 2022, Sven Barth wrote: Michael Van Canneyt via fpc-pascal schrieb am Fr., 23. Dez. 2022, 10:48: On Fri, 23 Dec 2022, Sven Barth via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal schrieb am Fr., 23. Dez. 2022, 08:18: On Thu, 22 Dec 2022, Andrew Haines via

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Andrew Haines via fpc-pascal
On 12/23/22 5:24 AM, Ondrej Pokorny via fpc-pascal wrote: This may be simpler: [TEnumAttr(['YES', 'NO', 'COULD_BE'])]   TMyEnum = (meYes, meNo, meCouldBe); TEnumAttr = class(TCustomAttribute)   protected     FValues: TStringArray;     FTypeName: String;   public     class function

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am Fr., 23. Dez. 2022, 10:48: > > > On Fri, 23 Dec 2022, Sven Barth via fpc-pascal wrote: > > > Michael Van Canneyt via fpc-pascal > > schrieb am Fr., 23. Dez. 2022, 08:18: > > > >> > >> > >> On Thu, 22 Dec 2022, Andrew Haines via fpc-pascal wrote: >

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Ondrej Pokorny via fpc-pascal
This may be simpler: [TEnumAttr(['YES', 'NO', 'COULD_BE'])]   TMyEnum = (meYes, meNo, meCouldBe); TEnumAttr = class(TCustomAttribute)   protected     FValues: TStringArray;     FTypeName: String;   public     class function FromType(ATypeInfo: PTypeInfo): TEnumAttr;     constructor

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Michael Van Canneyt via fpc-pascal
On Fri, 23 Dec 2022, Sven Barth via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal schrieb am Fr., 23. Dez. 2022, 08:18: On Thu, 22 Dec 2022, Andrew Haines via fpc-pascal wrote: Hi what I want to do is similar to this question here:

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Sven Barth via fpc-pascal
Michael Van Canneyt via fpc-pascal schrieb am Fr., 23. Dez. 2022, 08:18: > > > 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/ > >