Runtime Type Information (RTTI)/fr

From Free Pascal wiki
Revision as of 12:53, 19 April 2015 by Gillou58 (talk | contribs)
Jump to navigationJump to search

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