Function 24h Set Random Record Number

mov dx, seg FileFCB

mov ds, dx

mov dx, offset FileFCB ;ds:dx points to FCB

mov ah, 24h ;Set Random Record Number

int 21h

Set Random Record Number (Function 24h) sets the random record field in a file control block (FCB) to match the file position indicated by the current block and current record fields.

This function has been superseded by Move File Pointer (Function 42h).

Parameter

FileFCB

Points to an FCB structure that identifies an open file. The structure must have been previously filled by using Open File with FCB (Function 0Fh) or Create File with FCB (Function 16h). Also, the fcbRandomRecNo field must contain zero before this function is called. The FCB structure has the following form:

FCB STRUC

fcbDriveID db ? ;drive no. (0=default, 1=A, etc.)

fcbFileName db '????????' ;filename

fcbExtent db '???' ;file extension

fcbCurBlockNo dw ? ;current block number

fcbRecSize dw ? ;record size

fcbFileSize db 4 dup (?) ;size of file in bytes

fcbFileDate dw ? ;date file last modified

fcbFileTime dw ? ;time file last modified

fcbReserved db 8 dup (?) ;reserved

fcbCurRecNo db ? ;current record number

fcbRandomRecNo db 4 dup (?) ;random record number

FCB ENDS

For a full description of the FCB structure, see Chapter 3, “File System.”

Return Value

This function has no return value.

See Also

Function 0Fh Open File with FCB
Function 16h Create File with FCB
Function 21h Random Read
Function 22h Random Write
Function 42h Move File Pointer