0

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

Edited by pyTony: fixed formating

1
Contributor
1
Reply
2
Views
11 Years
Discussion Span
Last Post by jimtaylor
0

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

Jim Taylor

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.