[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function: SetDrive()
This function provides some control over the
Acces of logical drives from DOS. Using SetDrive()
one can set a drive letter as being the One that
has last accessed a Drive. Needs DOS 3.20!.
Syntax: SetDrive([<nDisk>]) --> nLastAssigned
Arguments: <nDisk> is the drive to Set, 0 or none indicates
current drive, 1=A: etc.. Note that the coding
begins with 0 = default and 1=A, contrary to some
other Disk functions.
Returns: a Numeric, 0 if the specified disk drive has only
One letter assigned to it, if Non Zero, the
function returns the highest possible drive Letter
the specified drive can be accessed with.
Usage: This function provides a documented and DOS
supported way to avoid the 'Insert Disk ..'
Message. A possible way is to allways execute
SetDrive(i+1) before Executing SetDisk(i), but one
can also check if drive X: was last accessed using
GetDrive() (it should be 0 or refer to X:), if
Not, Your program could generate a prompt asking
for a drive to be entered, and then execute
SetDrive() to avoid DOS' message.
The file EXPDEMO.PRG has a good example of usage
of this function, in the ChangeDrive() function.
See Also:
GetDrive()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson