IntroductionMTB StatementsFile SystemCompilerApplicationsReference GuideIndex

Get Handles

Syntax: DOSMS(AX-value,BX-value,CX-value,DX-value) EXCP=statement-label
Entry:
AX-value = "@FFF4@"
BX-value = Logical Unit Number of keyed file (file must 
           be open prior to this function call)
Return:
CX-value = the DOS handle of the data portion of the keyed file
DX-value = the DOS handle of the key tree (I00)
Discussion: The DOSMS function call can be used to get the handles of an open keyed file. Prior to executing this function, the keyed file must be open. This function requires the LUN of the open file.

This function returns two values. The CX-value contains the handle of the data portion of the keyed file, and the DX-value contains the handle of the key tree file (i.e., the I00 file).

Once your program has these file handles, it can use them to copy or otherwise manipulate the file.

The following code segment demonstrates this function:

OPEN (5) "AR1", DIR="DSK"     ! open keyed file on LUN 5
AX$ = "@FFF4@"                ! set AX to "get handles"
BX$ = "5"                     ! set BX to LUN
DOSMS(AX$,BX$,CX$,DX$)        ! execute function
DATA.HANDLE$ = CX$            ! CX = handle of data file
KEY.HANDLE$  = DX$            ! DX = handle of key tree 


DOS function calls/pseudo calls