DelphiBasics
PExtended
Type
Pointer to a Extended floating point value System unit
type PExtended = ^Extended;
Description
The PExtended type is a pointer to a Extended value.
 
Pointer arithmetic, such as Inc, Dec can be used on it, for example to navigate a block of Extended values, as in the example.
Related commands
DecDecrement an ordinal variable
ExtendedThe floating point type with the highest capacity and precision
IncIncrement an ordinal variable
 Download this web site as a Windows program.




 
Example code : Store 3 Extended values in memory and navigate through them
var
  extPtr : PExtended;

begin
  // Allocate storage for three extended variables
  GetMem(extPtr, 3 * SizeOf(Extended));

  // Fill out these extended variables
  extPtr^ := 123.45;
  Inc(extPtr);
  extPtr^ := 2.9;
  Inc(extPtr);
  extPtr^ := 87654321;

  // Now display these values
  Dec(extPtr, 2);
  ShowMessageFmt('Value 1 = %f',[extPtr^]);
  Inc(extPtr);
  ShowMessageFmt('Value 2 = %f',[extPtr^]);
  Inc(extPtr);
  ShowMessageFmt('Value 3 = %f',[extPtr^]);
end;
Show full unit code
  Value 1 = 123.45
  Value 2 = 2.90
  Value 3 = 87654321.00
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page