help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

ptr

Combine segment and offset to pointer

Declaration

Source position: systemh.inc line 526

function ptr(

  sel: LongInt;

  off: LongInt

):farpointer;

Description

Ptr returns a pointer, pointing to the address specified by segment Sel and offset Off.

Remark:
  1. In the 32-bit flat-memory model supported by Free Pascal, this function is obsolete.
  2. The returned address is simply the offset.

Errors

None.

See also

Addr

  

Return address of a variable

Example

Program Example59;

{ Program to demonstrate the Ptr (compability) 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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505