//---------------------------------------------------------------------------
void __fastcall TForm1::SaveDialog1CanClose(TObject *Sender,
bool &CanClose)
{
AnsiString name = SaveDialog1->FileName;
char c[1000] = "";
AnsiStringToCharPointer(c,name);
ofstream out(c);
for(int i = 1;i < Memo1->Lines->Count;i++)
{
AnsiString s = Memo1->Lines->operator [](i);
for(int j = 1; j < s.Length()+1; j++)
{
out << s[j];
}
out << '\n';
}
out.close();
}
Do'stlaringiz bilan baham: |