Pointer to a WideChar System unit
PWideChar = ^WideChar;
The PWideChar type holds a pointer to a WideChar value.
It can also be used to point to characters within a WideString, as in the example code.
As with other pointers, integer arithmetic, such as Inc and Dec can be performed on a PWideChar variable, also shown in the example.
PWideChar is principally used when processing null-terminated (C-like) strings.
Related commands
$ExtendedSyntaxControls some Pascal extension handling
DecDecrement an ordinal variable
IncIncrement an ordinal variable
PAnsiCharA pointer to an AnsiChar value
PCharA pointer to an Char value
PWideStringPointer to a WideString value
WideCharVariable type holding a single International character
WideStringA data type that holds a string of WideChars
 Download this web site as a Windows program.

Example code : Display all characters in a string
  myWideString  : WideString;
  myWideCharPtr : PWideChar;
  i : Integer;

  // Create a string of WideChar's
  myWideString  := 'Hello';

  // Point to the first character in the string
  myWideCharPtr := Addr(myWideString[1]);

  // Display the string

  // Now increment the pointer

  // And see what is shows now

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