add text to text area

I am trying to add a text to a text area using the following code: taEMR.text = taEMR.text + txtL1.text

The txtL1.text is a text result that has the result show in txtL1.text. I want to be able to add it to an existing amount of text so the result looks like: “The type of ballast needed is lead” where “The type of ballast needed is” preexists in the taEMR text area and the “lead” is from the txtL1.text.

taEMR.text = taEMR.text + txtLL1.text - results in an error: "Undefined operator. Type TextArea does not define “Operator_Add” with type String. I have gone through the Forum and Language Reference but cannot seem to find a solution. Is there one? All help is greatly appreciated. Thank you.

The LangRef is your friend

Works fine here with

[code]Dim s as string = “test”

Textarea1.text = s
Textarea1.text = textarea1.text + s
Textarea1.text = textarea1.text + s + textarea2.text[/code]

Using Xojo 2015 R2.3

There is something else happening here. Concatenating the Text properties of two TextAreas into a third one Text property should work. Are you sure you did put Text in every one ? To me this looks as if you forgot “.text” in one of the TextAreas.

I get exactly the error you describe with

TextArea3.Text = TextArea1.Text + TextArea2

Indeed you cannot add a control and a string.

???

[quote=210301:@Dave S]The LangRef is your friend

TextEdit.AppendText
Method
TextEdit.AppendText ( text as String )
Appends the passed text to the current Text. Call AppendText rather than using the + operator to append text to existing text.[/quote]

Thanks Dave - That’s exactly what I was after.