View Single Post
  #1  
Old 25-05-2020, 17:15
Emorian Emorian is offline
Registered User
 
Join Date: Oct 2011
Location: Hungary
Posts: 26
Thanks: 14
Thanked 4 Times in 4 Posts
Emorian is on a distinguished road
Quote:
Originally Posted by sakila(playboy) View Post
Can anyone tell me what's wrong this?

Work:
Red = you add
Green = delete
Code:
  var
   x, bit, i: Integer;
   tp: Cardinal;
   sd: string;
  Begin
   sd := ExpandConstant('{sd}');
   Result := ExpandConstant('{pf}\');
   x := GetLogicalDrives;
   If x <> 0 Then
    For i:= 1 To 64 Do
     Begin
      bit := x and 1;
      If bit = 1 Then
       Begin
        tp := GetDriveType(PAnsiChar(Chr(64 + i) + ':'));
        If tp = DRIVE_FIXED Then
         If Chr(64 + i) <> Copy(sd, 1, 1) Then
          Begin
           Result := Chr(64 + i) + ':\Games\';
           Break;
          End;
       End;
      x := x shr 1;
     End;
  End;
End;

Last edited by Emorian; 25-05-2020 at 17:19.
Reply With Quote
The Following User Says Thank You to Emorian For This Useful Post:
sakila(playboy) (04-06-2020)
Sponsored Links