Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function GetAvailableSpace(DriveLetter: Char): String;
var
DiskCapacity, FreeSpace: Extended;
begin
DriveLetter := UpCase(DriveLetter);
DiskCapacity := DiskSize(Ord(DriveLetter) - 64) / 1048576;
FreeSpace := DiskFree(Ord(DriveLetter) - 64) / 1048576;
if DiskCapacity <= 0 then
Result := 'Disk information not available'
else if FreeSpace > 1000 then
begin
DiskCapacity := DiskCapacity / 1024;
FreeSpace := FreeSpace / 1024;
Result := FormatFloat('#,##0.00', FreeSpace) + 'GB of ' + FormatFloat('#,##0.00', DiskCapacity) + 'GB';
end
else
Result := FormatFloat('#,##0', FreeSpace) + 'MB of ' + FormatFloat('#,##0', DiskCapacity) + 'MB';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
driveLetter: Char;
begin
for driveLetter := 'B' to 'Z' do
begin
if GetDriveType(PChar(driveLetter + ':\')) = DRIVE_FIXED then
ValueListEditor1.InsertRow('Available Space (' + driveLetter + ':)',
GetAvailableSpace(driveLetter), True);
end;
end;