Difference between revisions of "Runtime Type Information (RTTI)/fr"
From Free Pascal wiki
Jump to navigationJump to searchm |
m (Fixed syntax highlighting) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Editing Runtime Type Information (RTTI)}}<p> | {{Editing Runtime Type Information (RTTI)}}<p> | ||
− | RTTI peut être employée pour obtenir un nombre de méta informations dans une application Pascal. | + | La RTTI peut être employée pour obtenir un nombre de méta-informations dans une application Pascal. |
+ | |||
__TOC__ | __TOC__ | ||
− | |||
− | |||
− | <syntaxhighlight> | + | == Conversion d'un type énuméré en chaîne == |
+ | On peut utiliser la RTTI pour obtenir la chaîne d'un type énuméré. | ||
+ | |||
+ | <syntaxhighlight lang=pascal> | ||
type | type | ||
TProgrammerType = (tpDelphi, tpVisualC, tpVB, tpJava) ; | TProgrammerType = (tpDelphi, tpVisualC, tpVB, tpJava) ; | ||
Line 21: | Line 23: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | ==Voir aussi== |
*[[RTTI controls/fr|Contrôles RTTI]] | *[[RTTI controls/fr|Contrôles RTTI]] | ||
* http://www.blong.com/Conferences/BorConUK98/DelphiRTTI/CB140.htm | * http://www.blong.com/Conferences/BorConUK98/DelphiRTTI/CB140.htm |
Latest revision as of 14:45, 25 February 2020
│ 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'