I am new to Systools and I am having trouble with the sample that is provide in the help for GetDiskInfo. When I step through the code it complete skips the calculations for BytesPerCluster,DiskCapacity,etc. I'm not sure what I am doing wrong. Could someone give me a another example on how to use the function? Any help would be greatly appreciated.
Thanks
John
here's the sampel code I have.
var
BytesPerCluster,
DiskCapacity,
FreeSpace : Double;
Begin
if GetDiskInfo('c',ClustersAvailable,TotalClusters,BytesPersector,SectorsPerCluster) then
begin
****Skips this part of the code*******
BytesPerCluster := SectorsPerCluster * BytesPerSector;
DiskCapacity := TotalClusters * BytesPerCluster;
FreeSpace := ClustersAvailable * BytesPerCluster;
********************************
end else
ShowMessage(SysErrorMessage(GetLastError));
end;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code works fine. You must be getting an error of some kind which causes it to skip the lines that are processed when GetDiskInfo is true. Did you get an error message? Is there any reason you can't access the C drive?
Regards,
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply Tom. I'm not aware of any errors, but I will double check.
Thanks again,
John
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-05-30
It is not a Systools problem.
For the smart linker your code is doing nothing.
The variables (local) are inaccesibles due to optimization.
To bypass the problem, if you define global variables you are able to proceed step by step ...
Regards,
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to Systools and I am having trouble with the sample that is provide in the help for GetDiskInfo. When I step through the code it complete skips the calculations for BytesPerCluster,DiskCapacity,etc. I'm not sure what I am doing wrong. Could someone give me a another example on how to use the function? Any help would be greatly appreciated.
Thanks
John
here's the sampel code I have.
var
BytesPerCluster,
DiskCapacity,
FreeSpace : Double;
ClustersAvailable,
TotalClusters,
BytesPerSector,
SectorsPerCluster : Cardinal;
Begin
if GetDiskInfo('c',ClustersAvailable,TotalClusters,BytesPersector,SectorsPerCluster) then
begin
****Skips this part of the code*******
BytesPerCluster := SectorsPerCluster * BytesPerSector;
DiskCapacity := TotalClusters * BytesPerCluster;
FreeSpace := ClustersAvailable * BytesPerCluster;
********************************
end else
ShowMessage(SysErrorMessage(GetLastError));
end;
The code works fine. You must be getting an error of some kind which causes it to skip the lines that are processed when GetDiskInfo is true. Did you get an error message? Is there any reason you can't access the C drive?
Regards,
Tom
Thanks for the reply Tom. I'm not aware of any errors, but I will double check.
Thanks again,
John
It is not a Systools problem.
For the smart linker your code is doing nothing.
The variables (local) are inaccesibles due to optimization.
To bypass the problem, if you define global variables you are able to proceed step by step ...
Regards,
Maurizio