===========================================================================
Packet: PROGUILD
Date: 02-09-93 (00:16)             Number: 743
From: GREG ESTABROOKS              Refer#: NONE
  To: MARK MCGREGOR                 Recvd: NO
Subj: Disk Access                    Conf: (58) Pascal
---------------------------------------------------------------------------
MM>What would be the best way to see what Drive auser is currently on
MM>and to change to a different one? Same with the current path?

Here are some routines for Changing and detecting drives.

(*============================================================*)
Uses Crt, Dos;
Var
        Regs     :REGISTERS;

FUNCTION GetDrive :BYTE;
Begin
  Regs.AX := $1900;
  Intr($21,Regs);
  GetDrive := (Regs.AL + 1);
  (* Returns  1 = A:,   2 = B:,   3 = C:,  Etc  *)
End;

Procedure ChangeDrive(Drive :BYTE);
Begin
  Regs.AH := $0E;
  Regs.DL := Drive;  (*  Drive   1 = A:, 2 = B:, 3 = C:  *)
  Intr($21,Regs);
End;

Begin
  Clrscr;
  Writeln(' Current Drive : ',CHR( GetDrive+64 ));
End.

(*============================================================*)

Greg Estabrooks <<Message Entered on 02-08-93 at 10:42 pm>>
---
  OLX 2.1 TD  Modem sex begins with a handshake.
  QNet3  <NANET>  VE1EI/InfoServe Sambro NS  (902) 868-2475 HST Dual

