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
$ExtendedSyntax Controls some Pascal extension handling
Dec Decrement an ordinal variable
Inc Increment an ordinal variable
PAnsiChar A pointer to an AnsiChar value
PChar A pointer to an Char value
PWideString Pointer to a WideString value
WideChar Variable type holding a single International character
WideString A data type that holds a string of WideChars
 Author links

 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 2002 - 2020. All rights reserved.  |  Home Page