qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Seg and Ofs Functions
  Summary Details Example                                   Back
 
  Argument
 
    identifier    Name of the variable, procedure, or function
 
  Return
 
    Word          Segment or offset part of the address of identifier
 
  Description
 
    The Seg function gets the segment part of the address of a variable,
    procedure, or function. The Ofs function gets the offset part of the
    address. The segment and the offset are 16-bit addresses.
 
    The identifier variable can be any variable name or the name of a
    procedure or function.
 
    To get the segment and offset of the address of a pointer:
 
       seg_result := Seg( pointer_name );
       ofs_result := Ofs( pointer_name );
 
    To get the segment and offset of the address of a variable pointed
    to by a pointer:
 
       seg_result := Seg( pointer_name^ );
       ofs_result := Ofs( pointer_name^ );