Sign in Join
Wiki copytemporary

PChar/fr

Deutsch · English · Español · Français · Русский

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.

Revision 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 4 people, 2017–2021

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
E-ricCreated page
Mathias (minor)
TrevFixed syntax highlighting (minor)
Kai Burghardtrename of template Pchar to PChar Special: Diff/146650 (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.