There follows a fragment of a program in Borland C++:

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Memo1->Clear();
ListBox1->Clear();
Memo1->Lines->LoadFromFile("c:\\blitz\\history.txt");
a=Memo1->Lines->Count;
x=0;
while (x<a)
        {
    str1=Memo1->Lines->Strings[x];
    if (str1 != "")
            {
            DATA MANIPULATION HERE, THEN

            if (ListBox1->Items->Count==0)
                 ListBox1->Items->Strings[0]=str3;
            else
                 ListBox1->Items->Add(str3);
            }
    }
ListBox1->Items->SaveToFile("C:\\blitz\\history.txt");
Close();
}

The form does not close, but "history.txt" is OK.

Any notions?

Jim Taylor

Hey, I think I figured it out myself. It seems you can't Close() from an "On Create" situation.

Jim Taylor

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.