Rilevare la velocita della CPU Calcolo della pasqua cristiana
Aug 20

La funzione controlla se il drive indicato come parametro è pronto per l’utilizzo

function IsDriveReady(DriveLetter : char) : bool;
 
   var
 
     OldErrorMode : Word;
 
     OldDirectory : string;
 
   begin
 
     OldErrorMode := SetErrorMode(SEM_NOOPENFILEERRORBOX);
 
     GetDir(0, OldDirectory);
 
     {$I-}
 
     ChDir(DriveLetter + ':');
 
     {$I+}
 
     if IOResult <> 0 then
 
       Result := False
 
     else
 
       Result := True;
 
     ChDir(OldDirectory);
 
     SetErrorMode(OldErrorMode);
 
   end; { IsDriveReady }//Esempio di utilizzo:
 
if not IsDriveReady('A') then
 
     ShowMessage('Drive Not Ready')
 
else
 
     ShowMessage('Drive is Ready');

(Nessun voto)
Loading ... Loading ...

Inserisci il tuo Commento:

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a