1
I have the following code that adds the contents of a button and a space after clicked
procedure TForm3.Button1Click(Sender: TObject);
begin
if count = 0 then
Edit1.Text := Edit1.Text + TLabel(Sender).caption+ ' ';
if count = 1 then
begin
Edit2.Text := Edit2.Text + TLabel(Sender).caption+ ' ';
end;
end;
Saida: Dose = Max + Min
and another situation for number, which does not apply the spaces:
procedure TForm3.Button29Click(Sender: TObject);
begin
if count = 0 then
Edit1.Text := Edit1.Text + TLabel(Sender).caption;
if count = 1 then
begin
Edit2.Text := Edit2.Text + TLabel(Sender).caption;
end;
end;
Saida: Dose = 10
But I was thinking that after the number I could find a text and the way I would make the character after the number would come out like this
Saida: Dose = 10AND 20
Where the right would be:
Saida: Dose = 10 AND 20
How to treat the function so that when the next character after the number is a letter, it adds a space?
you could always add space, and at the end of the operation use the Trim() ?
– Passella
I could do that in a function, but if there’s an AND after the number, it wouldn’t do any good.
– Guilherme Lima
I mean, for both number and text, you add space, in your example, you just add to text, then at the end, you use Trim()
– Passella