TURBO PASCAL

Новости

Программы   

Turbo Pascal 

Игры

Документация   

Странности

FAQ

Ссылки

Форум

Гостевая книга

Рассылка

Благодарности

Об авторе

43: How to determine the last drive?

 A: One way of doing 
that is utilizing the information in DPB, that
is the Drive Parameter Block, but that is rather complicated, so you
can find that without source code in the TSUNTH unit in
ftp://garbo.uwasa.fi/pc/ts/tspa3470.zip .
 Another way is using interrupt 21H, function 36H to detect if a
drive exists starting from the first drive letter. The code is given
below. The disadvantage of this method is that it does not
distinguish between real and substituted drives.
  uses Dos;
  function LASTDFN : char;  (* Detect last harddisk letter *)
  var regs : registers;
      i    : byte;
  begin
    i := 2;
    repeat
      Inc(i);
      FillChar (regs, SizeOf(regs), 0);
      regs.ah := $36;
      regs.dl := i;
      MsDos(regs);
    until (regs.ax = $FFFF);
    lastdfn := chr(i+63);
  end;  (* lastdfn *)

 Contents

 

На первую страницу

Rambler's Top100 Rambler's Top100
PROext: Top 1000

(с)Все права защищены

По всем интересующим вопросам прошу писать на электронный адрес

Hosted by uCoz