| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1547 人关注过本帖
标题:[求助]DELPHI的编译问题
只看楼主 加入收藏
cch8080
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-3-18
结帖率:100%
收藏
 问题点数:0 回复次数:1 
[求助]DELPHI的编译问题

小弟是个刚学DELPHI的菜鸟,今天根据课本的一个编程例子来做了个程序,代码如下:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
sr:tsearchrec;
fileattrs:integer;
begin
stringgrid1.Rowcount:=1;
if checkbox1.Checked then
fileattrs:=fareadonly
else
fileattrs:=0;

if checkbox2.Checked then
fileattrs:=fileattrs+fahidden;

if checkbox3.Checked then
fileattrs:=fileattrs+fasysfile;

if checkbox4.Checked then
fileattrs:=fileattrs+favolumeid;

if checkbox5.Checked then
fileattrs:=fileattrs+fadirectory;

if checkbox6.Checked then
fileattrs:=fileattrs+faarchive;

if checkbox7.Checked then
fileattrs:=fileattrs+faanyfile;
with stringgrid1 do
begin
rowcount:=0;
if findfirst(edit1.text,fileattrs,sr) - 0 then
begin
cells(1,0):='文件名';
cells(2,0):='大小(K)';

repeat
if(sr.attr and fileattrs)=sr.attr then
begin
rowcount:=rowcount+1;
cells(1,rowcount-1):=sr.Name;
cells(2,rowcount-1):=inttostr(SR.Size);
end;
UNIT findnext(sr)<>0;
findclose(sr);
end;
end;
end;

end.
可编译时老是出现下面的错误提示:
[Warning]Unit1.pas(43):Symbol'faReadOnly'is specific to a platform
[Warning]Unit1.pas(48):Symbol'faHidden'is specific to a platform
[Warning]Unit1.pas(51):Symbol'faSysFile'is specific to a platform
[Warning]Unit1.pas(54):Symbol'faVolumeID'is specific to a platform
[Warning]Unit1.pas(60):Symbol'faArchive'is specific to a platform
[Error]Unit1.pas(67):Type of expression must be BOOLEAN
[Error]Unit1.pas(69):'['expected but '('found
[Error]Unit1.pas(70):'['expected but '('found
[Error]Unit1.pas(70):lllegal character in input file:';'($A3BB)
[Error]Unit1.pas(72):Missing operator or semicolon
[Error]Unit1.pas(76):'['expected but '('found
[Error]Unit1.pas(76):Left side cannot be assigned to
[Error]Unit1.pas(77):'['expected but '('found
[Error]Unit1.pas(77):Left side cannot be assigned to
[Error]Unit1.pas(79):Statement expected but 'UNIT'found
[Error]Unit1.pas(79):Statement expected,but expression of type 'Boolean'found
[Error]Unit1.pas(81):'UNTIL'expected but 'END' found
[Fatal Error]Project1.dpr(5):Could not compile used unit'Unit1.pas'
这是为什么呀,请各位高手帮忙看看,小弟在这先谢过大家了

搜索更多相关主题的帖子: DELPHI 编译 
2007-07-01 10:31
anthony634
Rank: 6Rank: 6
来 自:西南交大
等 级:贵宾
威 望:24
帖 子:653
专家分:10
注 册:2006-6-8
收藏
得分:0 

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls;

type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
sr:tsearchrec;
fileattrs:integer;
begin
// stringgrid1.Rowcount:=1;
fileattrs:=0;
// MyRowCount:= 0;
{$WARN SYMBOL_PLATFORM OFF}
if checkbox1.Checked then
fileattrs:=fareadonly ;
// ;

if checkbox2.Checked then
fileattrs:=fileattrs+fahidden;


if checkbox3.Checked then
fileattrs:=fileattrs+fasysfile;


if checkbox4.Checked then
fileattrs:=fileattrs+favolumeid;

if checkbox6.Checked then
fileattrs:=fileattrs+faarchive;
{$WARN SYMBOL_PLATFORM ON}

if checkbox5.Checked then
fileattrs:=fileattrs+fadirectory; //

if checkbox7.Checked then
fileattrs:=fileattrs+faanyfile;
with stringgrid1 do
begin

if findfirst(edit1.text,fileattrs,sr) = 0 then
begin
cells[1,0]:='文件名';
cells[2,0]:='大小(K)';
rowcount:=1;
repeat
if(sr.attr and fileattrs)=sr.attr then
begin
cells[1,rowcount]:=sr.Name;
cells[2,rowcount]:=inttostr(SR.Size);
rowcount := rowcount + 1;
end;
until
findnext(sr) <> 0;
findclose(sr);
end;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.Text := 'f:\*.*';
end;

end.

2007-07-02 11:28
快速回复:[求助]DELPHI的编译问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011982 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved