DelphiBasics
PShortString
Type
A pointer to an ShortString value System unit
type PShortString = ^ShortString;
Description
The PShortString type is a pointer to an ShortString value.
 
ShortString variables differ from string variables - the latter are referenced by a pointer. So you must use Addr to point to a ShotrString variable, as in the exemple.
Related commands
PStringPointer to a String value
ShortStringDefines a string of up to 255 characters
StringA data type that holds a string of characters
 Download this web site as a Windows program.




 
Example code : Display a short string using a pointer to it
var
  myString  : shortString;
  stringPtr : PShortString;

begin
  // Set up our short string
  myString := 'Hello World';

  // Point to our string
  stringPtr := Addr(myString);

  // Display the string using the pointer
  ShowMessage(stringPtr^);
end;
Show full unit code
  Hello World
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page