Sign in Join
Wiki copytemporary

PChar/de

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

Zurück zu den Datentypen.

Zurück zu den Character und String Typen.\

Der Datentyp PChar hat keine Einschränkung in der Grösse.

Der Datentyp PChar ist ein Zeiger auf einen Nullterminierten Stringtyp (ShortString, String, AnsiString) ohne Längenbegrenzung.

Zweck:

Der Datentyp PChar dient z. B. dem Datenaustausch wie z. B. mit DLL's oder wie hier mit der Messagebox:

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

Definition eines Datenfeldes vom Datentyp PChar:

pascal
 Var 
   p: PChar;

Beispiele für die gültige Zuweisung von Werten:

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

Beispiele für die ungültige Zuweisung von Werten:

pascal
   p := 45;

Im unteren Beispiel wurde der zu übergebende Wert nicht auf den Datentyp PChar umgewandelt (gecastet).


From the Free Pascal wiki, page "PChar/de", 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 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 6 people, 2012–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
OlafCreated page
Olaf
Olaf
Olaf
Olaf
Olaf (minor)
Olaf (minor)
Olaf (minor)
Olaf (minor)
Michllink added (minor)
FTurtleFTurtle moved page Pchar/de to PChar/de: fix case (minor)
FTurtle
Mathias (minor)
Mathias
Mathias (minor)
TrevFixed syntax highlighting; removed categories included in template (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.