Reading several text area fields and writing them all into one text area

Hi, guys,

I am trying to read several (6-7) TextArea fields and write the content into the separate TextArea field

Sounds simple but I got lost.

Would you please help.

Thank you.

Val


sepTA.text=ta1.text+ta2.text+ta3.text

if you have a control set

for i=0 to numofTAcontrols ' you need to supply this
   sepTA.appendText ta(i).text
next i

Hi, Dave,

Thank you.

I tried the first method and it puts all fields into one line.

I want the content of each field to start a new line in the final text.

Any suggestions?

Val

In my other application I used this code to read several fields and write them into a text file


  Dim t As TextOutputStream
  Dim f As FolderItem
  Dim dlg As SaveAsDialog
  Dim d as new Date
  
  
  dlg = New SaveAsDialog
  
  dlg.SuggestedFileName=("MY FILE " + str(d) )
  
  f = dlg.ShowModal() // open save as dialog for entering the file name and selecting location to save
  
  if f <> nil then // f different from nil
    t = f.CreateTextFile // create file in selected location
    t.WriteLine ("THIS IS THE CONTENT OF MY FILE")
    t.WriteLine
    t.WriteLine
    t.WriteLine"Field #1"
    t.WriteLine
    t.WriteLine (TextArea1.Text) // write date from TextArea to file
    t.WriteLine
    t.WriteLine
   t.WriteLine"Field #2"
    t.WriteLine
    t.WriteLine (TextArea2.text)
    t.WriteLine
    t.WriteLine
    t.WriteLine"Field #3"
    t.WriteLine
    t.WriteLine (TextArea3.text)
    t.WriteLine
    t.WriteLine
    t.WriteLine"Differential Diagnosis #2"
    t.WriteLine
    t.WriteLine (TextArea4.text)
    t.WriteLine
    t.WriteLine
   t.WriteLine"Field #4"
    t.WriteLine
    t.WriteLine (TextArea5.text)
    t.WriteLine
    t.WriteLine
   t.WriteLine"Field #6"
    t.WriteLine
    t.WriteLine (TextArea6.text)
    t.WriteLine
    t.WriteLine
    t.Close // close file
  else
    // user cancelled
  end if

It works as intended. In my new application, I am trying to do the same but to write into another text area field rather than to the text file.

Thank you for any help.

Val

Hi, Dave,

I found the answer. I need to use EndOfLine in between the fields.

Seems to be working.

Thank you, again.

Val

Have you read the manuals/guides yet?
Those help a lot with the simple stuff.

http://documentation.xojo.com under the section that says User Guide you’ll see 4 PDFs well worth reading.
Also, a basic introduction to programming: Xojo: Learn Xojo Programming

Once you’ve got a handle, almost everything you could wonder about is recorded in the Language Reference
For everything else, there’s us :slight_smile:

sepTA.text=ta1.text+ENDOFLINE+ta2.text+ENDOFLINE+ta3.text