1
I’m using a Tmemo which receives data from an Edit, but this data will be inserted x times, the question is as follows:
By pressing the button the Tmemo received the data as follows:
Memo1.Lines[10] := ('linha adicionada');
I would like that when clicking the button the edits were cleaned, and when the person entered the new data and pressing the same button, the data were inserted in the line below in case Memo1.Lines[11]
. and so repeatedly..
However below the line [10] there is information and your put the
Memo1.lines.add ('linha adicionada');
and the person not typing anything, will be blank– Guilherme Lima
In case we clarify your doubt, you always want to add a new line above line 10 ?
– Eduardo Binotto
Bottom of line 10. by clicking on the same button as the 10.
– Guilherme Lima
@Guilhermelima, post your code to clarify your question. Thank you.
– Eduardo Binotto
Memo1.Lines.Add(' dose = ' + funcao);
Memo1.Lines.Add(' '+'if'+' '+ cond1+':');
Memo1.Lines.Add(' '+ enta1);
By pressing the button 1 time, Tmemo receives this data .– Guilherme Lima
if you use
Memo1.Lines.Add
it will add in the next line.– Eduardo Binotto
Totally agree, the problem is how do I do so when I press the X times button, it will be added?
– Guilherme Lima
Using
Memo1.Lines.Add
because it will always add at the end ofMemo1
. Regardless of how many times you click the button.– Eduardo Binotto
Right, think about this scenario. Variable X gets the data from an Edit, and this variable is written in Tmemo. After that click the Edit button and the X variable will receive new values. And it should be written under the previous one.
– Guilherme Lima
x := edit1.text; memo1.lines.add(x); .
– Eduardo Binotto
I don’t think I’m explaining myself well I’ll add a real example: Edit will receive the following string: K1 > 90 after giving ok and writing to memo the person will type Edit will receive the following string K1 = 100 this string must be written below K1 > 90
– Guilherme Lima
So I don’t know where you’re going wrong, because with
memo1.lines.add();
will have a result equal to what you expect.– Eduardo Binotto