我需要它的参数是布尔类型的,而且函数体要有一个组件,可是提示错误?我是初学者,很多东西看不懂,也看不懂,请大家感谢中,只是解决这个问题,编译器提示:没有这个组件,但是我已经在面板中拖了这个组件到窗体上,代码:
function (a:boolean):boolean;
begin
result:=listbox1.selected[0];
end;
function (a:boolean):boolean;
begin
result:=listbox1.selected[0];
end;
解决方案 »
- delphi2007串口控件的问题
- dbgrid的列标题如何改名
- 如何修改XML中节点“<ID>数值</ID>”的“数值”?加急急急急!
- 机器名和计算机名有什么不同???
- 怎么样通过sql语句把一个表中的一条图片字段记录insert到另一个表?
- 紧急求救关于组建 MonthCalendar Onclick事件
- 我用ADOtable 和adoconnection 来连接数据库。但在运行时老是提示出错:couldnot convert variant of type(null) into type(string
- Delphi7中 使用tidhttp进行网站POST问题。高手来看看啊!
- shellexecute打开浏览器时如何输入用户名和口令
- 请问如何在DBGrid的表头中加回车
- 怎么取到系统及其使用的浏览器版本和安装的插件
- cxGrid1TableView1Column1字段的扩展属性选RichEdit,如何操作RichEdit呢?
Field definition not allowed after methods or properties;
Identifier expected but '(' found TForm1 = class(TForm)
Button1: TButton;
listbox1: TListBox;
procedure Button1Click(Sender: TObject);
private
function (a:boolean):boolean;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
function (a:boolean):boolean;
begin
result:=listbox1.selected[0];
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.SelectAll;
end;
function myName : boolean;
begin
result:=listbox1.selected[0];end;
TForm1 = class(TForm)
Button1: TButton;
listbox1: TListBox;
procedure Button1Click(Sender: TObject);
private
function abc(a:boolean):boolean;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}function TForm1.abc(a: boolean): boolean;
begin
result:=listbox1.selected[0];
end;procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.SelectAll;
end;end.
[Error] Unit1.pas(28): Undeclared identifier: 'listbox1'
[Error] Unit1.pas(15): Unsatisfied forward or external declaration: 'TForm1.zy'type
TForm1 = class(TForm)
Button1: TButton;
listbox1: TListBox;
procedure Button1Click(Sender: TObject);
private
function abc(a: boolean): boolean;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
function abc(a: boolean): boolean;
begin
result:=listbox1.selected[0];
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.SelectAll;
end;
function abc(a: boolean): boolean;鼠标放这里,然后 Ctrl+Shift+C ,然后再写代码。
把下面的这段代码,替换你的代码。就可以通过了。
type
TForm1 = class(TForm)
Button1: TButton;
listbox1: TListBox;
procedure Button1Click(Sender: TObject);
private
function abc(a: boolean): boolean;
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
function TForm1.abc(a: boolean): boolean;
begin
result:=listbox1.selected[0];
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.SelectAll;
end;