Mega Code Archive

 
Categories / Delphi / Types
 

Pextended - pointer to a extended floating point value

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 Dec Decrement an ordinal variable Extended The floating point type with the highest capacity and precision Inc Increment an ordinal variable 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