Difference between revisions of "Runtime Type Information (RTTI)/fr"

From Free Pascal wiki
Jump to navigationJump to search
m
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__
  
== 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é.
 
  
<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>
  
==See Also==
+
==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'

Voir aussi