home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / melyviz / cdrombol / pcxcdp9.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-31  |  863 b   |  43 lines

  1. program pcxcdp9;
  2.  
  3. uses PCXCDU9,CRT;
  4.  
  5. var
  6.    Ch      : Char;
  7.    OStatus : Word;
  8.  
  9. begin
  10.    ClrScr;
  11.    OStatus:=0;
  12.    Write('Status: ');
  13.    repeat
  14.       DStatus:=CDR_GetDeviceStatus;
  15.       if OStatus<>DStatus then
  16.       begin
  17.          GotoXY(10,WhereY);
  18.          ClrEol;
  19.          Write('Door ');
  20.          if Odd(DStatus)
  21.          then
  22.             Write('open ')
  23.          else
  24.             Write('closed ');
  25.          if Odd(DStatus SHR 1)
  26.          then
  27.             Write('unlocked')
  28.          else
  29.             Write('locked');
  30.          OStatus:=DStatus;
  31.       end;
  32.  
  33.       if Keypressed then Ch:=upcase(Readkey);
  34.       case Ch of
  35.          'E' : CDR_EjectDisk;
  36.          'C' : CDR_CloseTray;
  37.          'U' : CDR_LockDoor(False);
  38.          'L' : CDR_LockDoor(True);
  39.       end;
  40.    until Keypressed AND (Readkey=#27);
  41.    WriteLn;
  42. end.
  43.