Get Handles

From CometWiki

Revision as of 11:59, 13 June 2009 by Badge (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 the file (the file must
            be open prior to this function call)


Return:

CX-value = the DOS handle of the file
DX-value = the DOS handle of the key tree (I00 file)


Discussion:
The DOSMS function call can be used to get the handle(s) of an open file.
Prior to executing this function, the 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 open file, and the DX-value contains the handle of the key tree file (i.e., the I00 file) if the file is a keyed 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
Personal tools