Sign in Join
Wiki copytemporary

PChar/fr: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-\
21Le [[Data type/fr|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).\
32But : Le type de données **PChar** est utilisé, par exemple, pour l'échange de données avec des DLL.\
43Exemple :
54
65``` pascal
76Var
87 s: String;
98begin
109 s := 'Test';
1110 Application.MessageBox(PChar(s)),'Titre',MB_OK);
1211end;
1312```
1413
1514Définition d'un champ de donnée de type PChar :
1615
1716``` pascal
1817 Var
1918 p: PChar;
2019```
2120
2221Exemple d'affectation de valeur correcte :
2322
2423``` pascal
2524 p := 'Dies ist ein Null-terminierter String.';
2625 p := IntToStr(45);
2726```
2827
2928Exemple d'affectation de valeur incorrecte :
3029
3130``` pascal
3231 p := 45;
3332```
3433
3534Dans l'exemple ci-dessus, la valeur à affecter n'a pas été convertie en PChar(cast).\
3635
3736---
3837*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](/wiki-contact).*

Back to history