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.
Ptr Function
  Summary Details Example                                   Back
 
  Arguments
 
    segment    Integer expression representing the segment address
 
    offset     Integer expression representing the offset address
 
  Returns
 
    POINTER    A pointer value set to the segment:offset address
 
  Description
 
    The Ptr function constructs a pointer from a 32-bit memory address
    represented by 16-bit addresses in a segment argument and an offset
    argument. The result can be assigned to a pointer variable or used
    in place of a pointer variable.
 
    To set a pointer variable to the returned address:
 
       pointer_variable := Ptr( segment, offset );
 
    The pointer result is not typed. To use the returned pointer,
    dereference and typecast the returned value. For example, to get
    the first byte at the returned address:
 
       result := Byte( Ptr( segment, offset )^ );