Sign in Join
Wiki copytemporary

Revision 2 of 2, by Kai Burghardt on 9-3-2021. The page as it is now.

PChar/fr

Le type de donnée PChar n'a pas de limitation de taille et désigne une chaîne de caractère terminée par 0 (compatible avec les chaînes du lanagage C).
But : Le type de données PChar est utilisé, par exemple, pour l'échange de données avec des DLL.
Exemple :

pascal
Var 
  s: String;
begin
  s := 'Test';
  Application.MessageBox(PChar(s)),'Titre',MB_OK);
end;

Définition d'un champ de donnée de type PChar :

pascal
 Var 
   p: PChar;

Exemple d'affectation de valeur correcte :

pascal
   p := 'Dies ist ein Null-terminierter String.';
   p := IntToStr(45);

Exemple d'affectation de valeur incorrecte :

pascal
   p := 45;

Dans l'exemple ci-dessus, la valeur à affecter n'a pas été convertie en PChar(cast).\


From the Free Pascal wiki, page "PChar/fr", as it stood on 2021-09-03 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.