Tmemo problem

Hi

I have a program, where i want to write "notes" into a TMemo field, to show the status of subrutins that have been run. However, my program Freezes, when adding a line to the Memo field after every subrutine has been executed. If I make 3 time the add statement at the beginning of the code, it works fine, but adding text to the memo field after each call to a subrutine, it freezes... i do not know why it does not work !? Any idea??? Do i need a kind of "open", "Close" function of the Memo field to get it to work... i does not have that - correct me if I am wrong


1
2
3
4
5
6
7
8
9
 void xx();
Form->Memo1->Lines->Add("Status text1");

void yy();
Form->Memo1->Lines->Add("Status text2");

void zz();
Form->Memo1->Lines->Add("Status text3");
No there is no open or close methods for TMemo.
What do xx(), yy() and zz() do?
They make some calculations and generates some txt files with the result in them. It all runs perfect without the Memo field... but i would like to add it, so I can write a status to this memo field...
If I remember correctly TMemo->Lines have a BeginUpdate and EndUpdate function.
Try this and see if it makes a difference
1
2
3
4
5
6
7
8
TMemo->Lines->BeginUpdate();
void xx();
Form->Memo1->Lines->Add("Status text1");
void yy();
Form->Memo1->Lines->Add("Status text2");
void zz();
Form->Memo1->Lines->Add("Status text3");
TMemo->Lines->EndUpdate();	
THX.... Works, if i do it like this... :)


void xx();
TMemo->Lines->BeginUpdate();
Form->Memo1->Lines->Add("Status text1");
TMemo->Lines->EndUpdate();

void yy();
TMemo->Lines->BeginUpdate();
Form->Memo1->Lines->Add("Status text2");
TMemo->Lines->EndUpdate();

void zz();
TMemo->Lines->BeginUpdate();
Form->Memo1->Lines->Add("Status text3");
TMemo->Lines->EndUpdate();


Topic archived. No new replies allowed.