Ptr function
Combine segment and offset to pointer.
Declaration
function Ptr(sel: LongInt; off: LongInt): FarPointerDescription
Ptr returns a pointer, pointing to the address specified by
segment
Sel and offset
Off.
- In the 32/64-bit flat-memory model supported by Free Pascal, this function is obsolete.
- The returned address is simply the offset.
Errors
None.
See also
Example: ex59
Program Example59;
{ Program to demonstrate the Ptr (compatibility) function. }
type pString = ^String;
Var P : pString;
S : String;
begin
S:='Hello, World !';
P:=pString(Ptr(Seg(S),Longint(Ofs(S))));
{P now points to S !}
Writeln (P^);
end.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
