Function 21h (33)        Random Read, Using FCBs
 
    Reads a specified record from a file into memory at the current Disk
    Transfer Address (DTA).
 
       On entry:      AH         21h
                      DS:DX      Pointer to an opened FCB
 
       Returns:       AL         00h      If read was successful
                                 01h      If EOF encountered and no data read
                                 02h      If DTA too small (segment wrap)
                                 03h      If EOF encountered and partial
                                          record read
 
       Network:       Requires Read access rights
 
  --------------------------------------------------------------------------
 
    This function reads the record specified by the random-record field
    (offset 21h) and the record-size field (offset 0Eh) of the FCB. The
    current block and current record fields are set to reflect the random-
    record field, and the record is read into memory at the current Disk
    Transfer Address.
 
       Notes:         The random-record field is not updated after this
                      function. It is your program's responsibility to set
                      this field each time it calls this function.
                      Function 27h, which is similar to this function,
                      will automatically update the random-record field.
                      (Function 27h can also read multiple records.)
 
                      If an EOF is encountered before a full record has
                      been read, the remainder of the record is padded to
                      the requested size with zeros.
 
                      The data is read in at the current Disk Transfer
                      Address (DTA). Use Function 1Ah to set the DTA. If
                      the transfer of data would cause segment wraparound,
                      an error 2 is generated.

Seealso:



This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster