Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 6e47c246994dbf209b12f1dffb028211 > files > 562

fpc-base-2.4.4-5mdv2010.2.x86_64.rpm

program showcds;

{$mode objfpc}
{$h+}

uses cdrom,sysutils;

Var
  Drives : Array[1..10] of String;
  I,Count : Integer;

begin
  Try
    Count:=GetCDRomDevices(Drives);
    Writeln('This PC has ',count,' CD-ROM drives');
    For I:=1 to count do
      Writeln('Drive ',i,' on device: ',Drives[i]);
  Except
    On E : exception do
      Writeln(E.ClassName,' exception caught with message: ',E.Message);
  end;
end.