procedure TFrm_Main.GetDisks;
var
str:string;
Drivers:Integer;
driver:char;
i,temp,disksizee:integer;
d1,d2,d3,d4: DWORD;
J:Integer;
ListItem: TListItem;
begin
Drivers:=GetLogicalDrives;
temp:=(1 and Drivers);
for i:=0 to 26 do
begin
if temp=1 then
begin
driver:=char(i+integer('A'));
str:=driver+':';
if (driver<>'') and (getdrivetype(PChar(str))<>drive_cdrom) and (getdrivetype(PChar(str))<>DRIVE_REMOVABLE) then
begin
GetDiskFreeSpace(PChar(str),d1,d2,d3,d4);
ListItem := MainList.Items.Add;
ListItem.ImageIndex:=0;
with ListItem do
begin
Caption := str;
J:=SubItems.Add(Format('总空间: %f GB',[d4/1024/1024/1024*d2*d1])+Format('剩余空间: %f GB',[d3/1024/1024/1024*d2*d1]));
J:=SubItems.Add(Format('剩余空间: %f GB',[d3/1024/1024/1024*d2*d1]));
J:=SubItems.Add(datetimetostr(Now()));
MainList.Items.EndUpdate;
end;
end;
end;
drivers:=(drivers shr 1);
temp:=(1 and Drivers);
end;
end;这是我的代码!总共提示有两个错误
1:[Error] Frm_Main_U.pas(1129): Invalid typecast
2:[Error] Frm_Main_U.pas(1131): Statement expected, but expression of type 'LongBool' found谁能帮解决啊!!! 在线等啊
var
str:string;
Drivers:Integer;
driver:char;
i,temp,disksizee:integer;
d1,d2,d3,d4: DWORD;
J:Integer;
ListItem: TListItem;
begin
Drivers:=GetLogicalDrives;
temp:=(1 and Drivers);
for i:=0 to 26 do
begin
if temp=1 then
begin
driver:=char(i+integer('A'));
str:=driver+':';
if (driver<>'') and (getdrivetype(PChar(str))<>drive_cdrom) and (getdrivetype(PChar(str))<>DRIVE_REMOVABLE) then
begin
GetDiskFreeSpace(PChar(str),d1,d2,d3,d4);
ListItem := MainList.Items.Add;
ListItem.ImageIndex:=0;
with ListItem do
begin
Caption := str;
J:=SubItems.Add(Format('总空间: %f GB',[d4/1024/1024/1024*d2*d1])+Format('剩余空间: %f GB',[d3/1024/1024/1024*d2*d1]));
J:=SubItems.Add(Format('剩余空间: %f GB',[d3/1024/1024/1024*d2*d1]));
J:=SubItems.Add(datetimetostr(Now()));
MainList.Items.EndUpdate;
end;
end;
end;
drivers:=(drivers shr 1);
temp:=(1 and Drivers);
end;
end;这是我的代码!总共提示有两个错误
1:[Error] Frm_Main_U.pas(1129): Invalid typecast
2:[Error] Frm_Main_U.pas(1131): Statement expected, but expression of type 'LongBool' found谁能帮解决啊!!! 在线等啊
解决方案 »
- SkinPageControl的问题
- 一个比较简单的问题!delphi错误信息!
- 十万火急,救助于动态插入数据问题!急急急!!!!!!!!1
- 寻找关于Delphi7控件及函数使用的书。100相谢,没办法系统让我只能给这么多!顶就有分。
- 求助高手
- 我用WebBrowser控件写了个自动注册网页ID的程序,可是每次做完之后都是同一个账号,请问怎样可以每次申请的时候,都让WebBrowser控件刷新
- 小问题
- 如何实现在dbgrid中,让多个单元格变颜色?(不要整行) 急!在线等待!!
- query与table
- filter的问题
- 关于FastReport求助
- TCP监听与获取本机IP会冲突?请大家指教。
比如说 J:=SubItems.Add(Format('总空间: %f GB',[d4/1024/1024/1024*d2*d1])+Format('剩余空间: %f GB',[d3/1024/1024/1024*d2*d1]));
这里它一定要返回值才行!!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ImageEx, ImgList, StdCtrls, Grids, jpeg,
CheckLst, ComCtrls;
把 syntax options 里的 extended syntax 和 huge strings 勾上
你的答案
project options -> compiler
把 syntax options 里的 extended syntax 和 huge strings 勾上 解决了我的问题,调试通过了!!谢谢啦!!