Runtime Type Information (RTTI)/fr
From Free Pascal wiki
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'