B4J Question BBCodeView

ivanomonti

Expert
Licensed User
Longtime User
Is there a way to append the new string instead of rewriting the entire text?

For example, in WhatsApp, if I write a question and then receive an answer later, I can append the answer to the original text using a code like "BBCodeView_response_to_your_question.txt = BBCodeView_response_to_your_question.txt & chr(10) + response."

The problem is that I also receive links, which I need to treat as such with the prefix "". This can be difficult, especiall... advice? [ATTACH type="full"]140163[/ATTACH]
 

Attachments

  • 1678540768748.png
    1678540768748.png
    212.9 KB · Views: 122

MicroDrie

Well-Known Member
Licensed User
Longtime User
You can retrieve the current BBCodeView1.Text content and put it in a variable named as let say old.

When u receive a response with a content that needs to "adjustments" based on a thing like a link then you can replace the link reference with the content of the link if you want that. Depending on the complexity you can you Regex or use a solution based on the B4A Library [B4X] MiniHtmlParser - simple html parser implemented with B4X example.

Then you can update the content as BBCodeView1.Text = $"${old} ${chr(10)} ${response}"$
 
Upvote 0
Top