fpc/packages/cdrom/examples/showcds.pp
Michaël Van Canneyt 7e1f1a31b0 * PChar -> PAnsiChar
2023-07-15 18:22:40 +02:00

23 lines
422 B
ObjectPascal

program showcds;
{$mode objfpc}
{$h+}
uses cdrom,sysutils;
Var
Drives : Array[1..10] of AnsiString;
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.