Add rows to a certain place in TMemo

1

I have some variables that get some data from a common edit. My question is the following, the person will click the button and TMemo will receive the data, I would like in this action he would clean the same edit and repeat the process as many times as necessary, however I need to insert this data in the Tmemo , as the example below:

    Memo1.Lines.Add(var1); #linha adicionada ao clicar no botão.
    Memo1.Lines.Add('linha adicionada'); # essa linha deve ser adicionada após a
    anterior quando o usuário clicar no mesmo botão.
    Memo1.Lines.Add('linha adicionada2');
    
asked by anonymous 24.09.2015 / 13:40

1 answer

1

You can use the following commands to write to a particular line of TMemo :

Memo1.Lines[3] := 'asd';

Or you can do this too:

Memo1.Lines.Insert(3, 'asd');

If you need to delete a line in specific use:

Memo1.Lines.Delete(3);
    
24.09.2015 / 13:43