home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12334.ZIP / SETDRIVE.BAS < prev    next >
BASIC Source File  |  1989-03-23  |  371b  |  15 lines

  1. '***** SetDrive.Bas - BASIC subprogram that sets the current drive
  2.  
  3. 'syntax: CALL SetDrive(Drive$)
  4. ' where: Drive$ is specified as "A", "B", and so forth
  5.  
  6. DEFINT A-Z
  7. DECLARE FUNCTION DosSelectDisk%(BYVAL Drive)
  8.  
  9. SUB SetDrive(Drive$)
  10.  
  11.    Drive = ASC(UCASE$(Drive$)) - ASC("A") + 1    'now "A" = 1, "B" = 2, etc.
  12.    ErrorCode = DosSelectDisk%(Drive)
  13.  
  14. END SUB
  15.