Runtime Type Information (RTTI)/fr

From Lazarus wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

English (en) français (fr) русский (ru)


La RTTI peut être employée pour obtenir un nombre de méta-informations dans une application Pascal.


Conversion d'un type énuméré en chaîne

On peut utiliser la RTTI pour obtenir la chaîne d'un type énuméré.

type
  TProgrammerType = (tpDelphi, tpVisualC, tpVB, tpJava) ;

uses TypInfo;

var 
  s: string;
begin
  s := GetEnumName(TypeInfo(TProgrammerType), integer(tpDelphi));
  // Ici = 'tpDelphi'

Voir aussi