unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl, ExtCtrls, XPMan;type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FileListBox1: TFileListBox;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
function change(souces,desc:string):boolean;
public { Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
function change(souces,desc:string):boolean;
var
i:integer;
s:string;
desstr,sourstr:array [0..255] of char;
begin
i:=0;
result:=false;
if (trim(desc)<>'') and (trim(souces)<>'')then
begin
i:=pos(string(strrscan(pchar(souces),'\')),souces);
s:=copy(souces,0,i);
chdir(s);
s:=s+desc;
strcopy(@sourstr,pchar(souces));
strcopy(@desstr,pchar(s));
if movefile(@sourstr,@desstr) then
result:=true;
end;
end;procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if change(directorylistbox1.Directory,edit1.Text) then
begin
showmessage('修改目录名成功!!');
DirectoryListbox1.Update;
end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
if Change(filelistbox1.FileName,edit1.Text) then
begin
showmessage('修改文件名成功!!');
FileListbox1.Update;
end
else
showmessage('修改文件名时出错!!请查看新名称是否正确!');
end;procedure TForm1.FormCreate(Sender: TObject);
begin
DriveComboBox1.Drive:='c';
end;end.
[Error] Unit1.pas(28): Unsatisfied forward or external declaration: 'TForm1.change'
望高手解答。在此先谢过
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl, ExtCtrls, XPMan;type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
FileListBox1: TFileListBox;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
function change(souces,desc:string):boolean;
public { Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
function change(souces,desc:string):boolean;
var
i:integer;
s:string;
desstr,sourstr:array [0..255] of char;
begin
i:=0;
result:=false;
if (trim(desc)<>'') and (trim(souces)<>'')then
begin
i:=pos(string(strrscan(pchar(souces),'\')),souces);
s:=copy(souces,0,i);
chdir(s);
s:=s+desc;
strcopy(@sourstr,pchar(souces));
strcopy(@desstr,pchar(s));
if movefile(@sourstr,@desstr) then
result:=true;
end;
end;procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if change(directorylistbox1.Directory,edit1.Text) then
begin
showmessage('修改目录名成功!!');
DirectoryListbox1.Update;
end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
if Change(filelistbox1.FileName,edit1.Text) then
begin
showmessage('修改文件名成功!!');
FileListbox1.Update;
end
else
showmessage('修改文件名时出错!!请查看新名称是否正确!');
end;procedure TForm1.FormCreate(Sender: TObject);
begin
DriveComboBox1.Drive:='c';
end;end.
[Error] Unit1.pas(28): Unsatisfied forward or external declaration: 'TForm1.change'
望高手解答。在此先谢过
解决方案 »
- 求购<DELPHI面向对象编程思想> 作者刘艺
- IdHttp断开释放,但是通过防火墙看到连接数疯涨
- 有没有能实现展开功能的类似ListView报表控件?
- 审核问题
- 问大家一个关于DLL调用小问题?对大家来说应该很简单
- 新人求助!这样的SQL语句应该怎么写?如何触发TDBGrid的OnClick事件?
- 如何使image平滑移动且速度快些?
- 串口通讯时:把MSComm1.Output:=Buf;出错?
- 非常菜的问题----delphi5和delphi5ado补丁的序列号有谁能告一下
- 请教在ComboBoxEx和ImageList结合使用中,如何获得所选图片的索引值?(十万火急!)
- 使用winexec执行大智慧程序时出错
- Twebbrowser中如何显示菜单条
为
function TForm1.change(souces,desc:string):boolean;