{--------------------------------------------------------------}
{                          ShowDir                             }
{                                                              }
{              "GetDir" demonstration program                  }
{                                                              }
{                             by Jeff Duntemann                }
{                             Turbo Pascal V3.0                }
{                             Last update 5/6/86               }
{                                                              }
{    From the book, COMPLETE TURBO PASCAL, by Jeff Duntemann   }
{    Scott, Foresman & Co. (c) 1986,1987  ISBN 0-673-18600-8   }
{--------------------------------------------------------------}

PROGRAM ShowDir;

VAR
  I,Error : Integer;
  CurrentDirectory : String[80];

BEGIN
  FOR I := 0 TO 4 DO
    BEGIN
      GetDir(I,CurrentDirectory);
      IF I = 0 THEN Write('Logged drive: ')
        ELSE Write('Drive      ',Chr(64+I),': ');
      Writeln(CurrentDirectory)
    END
END.
