Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Get count of members in record (https://www.delphipraxis.net/145892-get-count-members-record.html)

alzaimar 10. Jan 2010 12:27

Re: Get count of members in record
 
Zitat:

Zitat von himitsu
Zitat:

Zitat von nanix
yea himitsu add all these functions for each record i have over 35 would be mad crazy :gruebel: :oops:

Well, whoever wants it easier later, you first have to invest some work.

2-3 hrs. WTF. As an alternative, replace your records by DTO this might be a bit more work but gives you the advantage of RTTY and OOP.

nanix 10. Jan 2010 13:03

Re: Get count of members in record
 
an example would be more than welcome

thanks

alzaimar 10. Jan 2010 14:11

Re: Get count of members in record
 
Replace 'RECORD' by 'CLASS', publish or public your record fields as properties and you're almost through. You'll also be able to add some serialisation/deserialisation routines in case you need them.

nanix 10. Jan 2010 14:32

Re: Get count of members in record
 
what about this approach


Delphi-Quellcode:
type
 TProperties = TDictionary<string,string>;
 TInstances = TDictionary<string, string>;
 TClases = TDictionary<integer, TInstances>;

 Clases := TClases.Create;

 Clases.AddOrSetValue(0, TInstances.Create);
Clases[0].AddOrSetValue('1sdfgsdfgs', 'sdfgsdfgsdfgsdfgsdfgsdfgsdfg2');


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:03 Uhr.
Seite 2 von 2     12   

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