Runtime Type Information (RTTI)/fr

From Free Pascal wiki
Revision as of 20:14, 20 July 2014 by E-ric (talk | contribs) (Created page with "{{Editing Runtime Type Information (RTTI)}}<p> RTTI peut être employée pour obtenir un nombre de méta informations dans une application Pascal. __TOC__ == Conversion d'u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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


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

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

On peut utiliser la RTTI pour obtenir une 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'

See Also