home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 13 / CDA13.ISO / cdactual / demobin / share / program / Pascal / 10TLST.ZIP / NXTAVAIL.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-10-09  |  798 b   |  38 lines

  1. Program CheckNextLetter;
  2. Uses CRT,Tentools;
  3. VAR
  4.    NEXT : Char;
  5. Function NextLetter : Char;
  6. VAR
  7.    SDArray : DriveArray;
  8.    KChar,RetChar : Char;
  9.    Ret : Word;
  10.    K : Integer;
  11. Begin
  12.    RetChar:='C';
  13.    K:=20;
  14.    If ((Mountlist(SDArray,K)=0)and (K>0))
  15.    then
  16.     begin
  17.        KChar:='D';
  18.        While not ((SDArray[KChar].ServerID='            ')or(KChar=Char(K+64))) do
  19.        KChar:=Succ(KChar);
  20.        If KChar<>Char(K+64) then RetChar:=KChar else RetChar:=#0;
  21.     end;
  22.    NextLetter:=RetChar;
  23. End;
  24. Begin
  25.    NEXT:=NextLetter;
  26.    If (Next<>#0)
  27.    then
  28.     begin
  29.        Writeln('Next Mountable Drive: ',Next);
  30.        Halt(Ord(Next)-64);
  31.     end
  32.    else
  33.     begin
  34.        Writeln(^G,'No free drives available for mounting...');
  35.        Halt(255);
  36.     end;
  37. End.
  38.