AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Get count of members in record

Ein Thema von nanix · begonnen am 10. Jan 2010 · letzter Beitrag vom 10. Jan 2010
 
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.376 Beiträge
 
Delphi 12 Athens
 
#4

Re: Get count of members in record

  Alt 10. Jan 2010, 11:33
If you want to have such functionality, then you must implement it yourself.

Since Delphi 2010 it is could possibly even take the new RTTI support.




since Delphi 2006 / Turbo Delphi

Delphi-Quellcode:
TPerfFormattedData_PerfOS_Processor = record
  C1TransitionsPerSec: String;
  C2TransitionsPerSec: String;
  ...
  Timestamp_Sys100NS: String;
private
  function GetProp(i: Integer): String;
public
  property Prop[i: Integer]: String read GetProp;
end;
or

Delphi-Quellcode:
TPerfFormattedData_PerfOS_Processor = record
  C1TransitionsPerSec: String;
  C2TransitionsPerSec: String;
  ...
  Timestamp_Sys100NS: String;
end;

TPerfFormattedData_PerfOS_Processor_Helper = record helper for TPerfFormattedData_PerfOS_Processor
private
  function GetProp(i: Integer): String;
public
  property Prop[i: Integer]: String read GetProp;
end;
Delphi-Quellcode:
function TPerfFormattedData_PerfOS_Processor{_Helper}.GetProp(i: Integer): String;
begin
  case i of
    0: Result := C1TransitionsPerSec;
    1: Result := C2TransitionsPerSec;
    ...
    23: Result := Timestamp_Sys100NS;
    else Raise Exception.Create('invalid index');
  end;
end;
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz