编译的时候出现如下错误,请帮我看一下啊
Build
[C++ Error] tihuanlianxi.cpp(37): E2333 Class member '_fastcall TForm1::ReplaceDialog1Replace(TObject *)' declared outside its class
[C++ Error] tihuanlianxi.cpp(38): E2040 Declaration terminated incorrectly
程序的代码如下:
#include <vcl.h>
#pragma hdrstop
#include "tihuanlianxi.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(OpenDialog1->Execute())
Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
ReplaceDialog1->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
if(SaveDialog1->Execute())
Memo1->Lines->SaveToFile(SaveDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ReplaceDialog1Replace(TObject *Sender);
{
int SelPos;
Boolean flag;
int n;
TReplaceDialog *dlg=(Treplacedialog*)Sender;
SelPos=(Memo1->Lines->Text).Pos(dlg->FindText);
if(dlg->Options.Contains(frReplace))
{
if(SelPos>0)
{
Memo1->selstart=selPos-1;
Memo1->SelLength=(dlg->findtext).Length();
Memo1->selText=dlg->ReplaceText;
}
else
MessageDlg("not found"+dlg->findtext,mterror,TMsgDlgVButtons()<<mbOK,0);
}
if(dlg->Options.Contains(frReplaceAll))
{
if(SelPos>0)
flag=true;
else flag=false;
n=0;
if(flag)
{
while(SelPos>0)
{
Memo1->selstart=selPos-1;
Memo1->SelLength=(dlg->Findtext).Length();
Memo1->selText=dlg->ReplaceText;
SelPos=(Memo1->Lines->Text).Pos(dlg->FindText);
n++;
}
MessageDlg("全部替换完毕!共完成"+IntoStr(n)+"处替换。",mtInformation,TMsgDlgButtons()<<mbOK,0);
}
else
MessageDlg("not found"+dlg->FindText,mtError,TMsgDlgButton()<<mbOK,0);
}
}
为什么会出现哪种错误呢?我该如何去改,谢谢大侠们......