Display Free Hard Disk Size Of SCSI Hard Drive

Hi everyone,

   I wrote a program to display all the local hard drives' size
recently. It is working fine on all IDE hard drives until when I used it
to test the SCSI hard drives. When the program runs under SCSI based
hard drive, I always ge the runtime error 200 message. I would like to
know what does runtime error 200 mean?

   I am attaching my program here together with this email. If anyone
has any clue to the problem, please help. Thanks you very much

Regards,
Gan
Email : ka...@tm.net.my, gankok...@hotmail.com

[ free.pas 4K ]
program DiskSpace;
{$M 8192,0,0}
uses CRT, Dos;
var DriveNumber, J, Counter : word;
var c: char;

Begin
  clrscr;
  Counter := 2;
  Repeat
    Counter := Counter + 1;
  Until ((DiskSize(Counter)=-1));

  if Counter<= 6 then
  Begin
  For J := 3 to (Counter -1) do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  End
  else if ((Counter>6) and (Counter <=9)) then
  Begin
  For J := 3 to 5 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 6 to (Counter -1) do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  End
  else if ((Counter>9) and (Counter <=12)) then
  Begin
  For J := 3 to 5 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 6 to 8 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 9 to (Counter -1) do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  End
  else if ((Counter>12) and (Counter <=15)) then
  Begin
  For J := 3 to 5 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 6 to 8 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 9 to 11 do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  For J := 12 to (Counter -1) do
  Begin
    Textcolor(Yellow);
    writeln('***** Display free disk space on drive ', chr(64+J), ': *****');
    SwapVectors;
    Exec(GetEnv('COMSPEC'), '/C DIR ' + chr(64+J) + ':\*.gan /p');
    if DosError <> 0 then writeln('Dos Error # ', DosError);
    SwapVectors;
  End;
  End;
  writeln;
  Textcolor(LightRed);
  write('Total number of hard disk partitions = ', (Counter-3));
  Textcolor(LightCyan);
  writeln('          By Gan KA');
  writeln;
  Textcolor(LightGreen);
  write('Press any key to continue ...');
  c:=readkey;
  writeln;
  Textcolor(White);
End.