A pointer to an AnsiChar value System unit
type PAnsiChar = ^AnsiChar;
The PAnsiChar type is a pointer to an AnsiChar value.
It can also be used to point to characters within an AnsiString, as in the example code.
As with other pointers, integer arithmetic, such as Inc and Dec can be performed on a PAnsiChar variable, also shown in the example.
PAnsiChar is principally used when processing null-terminated (C-like) strings.
Related commands
$ExtendedSyntaxControls some Pascal extension handling
AnsiCharA character type guaranteed to be 8 bits in size
AnsiStringA data type that holds a string of AnsiChars
DecDecrement an ordinal variable
IncIncrement an ordinal variable
PCharA pointer to an Char value
PWideCharPointer to a WideChar
 Download this web site as a Windows program.

Example code : Display all characters in an AnsiString
  myString  : AnsiString;
  myCharPtr : PAnsiChar;
  i : Integer;

  // Create a string of AnsiChar's
  myString  := 'Hello World';

  // Point to the first character in the string
  i := 1;
  myCharPtr := Addr(myString[i]);

  // Display all characters in the string
  while i <= Length(myString) do
Show full unit code
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page