s2;
s2 = StringReplace(s, s1, "", TReplaceFlags() << rfReplaceAll);
Label8->Caption = " = " + IntToStr(SymbolEntersCount(s2, Edit2->Text));
Label6->Caption = "Загальна кількість букв у тексті: " + IntToStr(s.Length());
try
{
Memo1->Lines->SaveToFile("TEXT");
}
catch(...) {;}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1CloseUp(TObject *Sender)
{
Button1Click(this);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
Button1Click(this);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1Change(TObject *Sender)
{
Button1Click(this);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit2Change(TObject *Sender)
{
Button1Click(this);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
Memo3->Lines->SaveToFile("TEXT");
TForm1(this);
Button1Click(this);
}
//---------------------------------------------------------------------------
Лістинг Project1.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------