我需要它的参数是布尔类型的,而且函数体要有一个组件,可是提示错误?我是初学者,很多东西看不懂,也看不懂,请大家感谢中,只是解决这个问题,编译器提示:没有这个组件,但是我已经在面板中拖了这个组件到窗体上,代码:
function (a:boolean):boolean;
begin
result:=listbox1.selected[0];
end;
function (a:boolean):boolean;
begin
result:=listbox1.selected[0];
end;
解决方案 »
- expecting:integer actual:float本以为简单,但事实不是。
- 如何让通过点击button把edit中的数据传到listview中去
- fastreport如何实现这样的报表,急!!!!!!!
- copyrect 问题。。。。。。。。。。
- 为什么我批量产生的线程--传入的数据都变成了最后一次的那个?详情进来看看,很奇怪
- enter鍵的問題:
- 谁做过CRC校验程序吗?
- delphi有几个版本?
- 数据模块的问题,高手请进!
- 谁能进入国家网络安全中心?!
- 怎么取到系统及其使用的浏览器版本和安装的插件
- 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;