I am sending a message using Lotus Script Send. The message can be long. When the message is sent to to a client, the message is not being wrapped correctly. Words are being split from one line to the next, instead of being moved to the next line.
If the client is resized just a bit, the message is being displayed correctly.
Has anyone else seen this issue? Is there anyway to avoid it?
I don’t think I have ever noticed this problem before. Perhaps I have never happened to have a message with a longer word at the end of the line??
Subject: Solved (sort of) - Message is not being formated correctly until client is resized.
I have a function that calls AppendText one character at time. My theory is that AppendText is somehow adding an “end of word” character after the text. So each character becomes it’s own word. But since you can’t see the formatting within a rich text field, there is no way to prove this theory.
Subject: RE: Solved (sort of) - Message is not being formated correctly until client is resized.
It is not an end of word marker, but each character becomes its own text record, and the wrap will either happen at the end of a word in a string of text or at the end of a text record. It is horribly inefficient to add a character at a time like that. Is there any way you could add them to a buffer and then write the whole buffer out at once?
Subject: RE: Solved (sort of) - Message is not being formated correctly until client is resized.
Inefficient? Yes! but easy coding wise.
I just changed my code to add the character to a buffer, wait for a space then output the whole “word”. I could probably optimize it a little more but this was an easy fix.
Is there anyway to see all of the special codes in an RTF?
I actually have a pretty cool class that allows you to enter text into a field along with keywords. The class then processes the text, subsituting values for the keywords. You can also have keywords for database, view and doclinks. Basiclly it allows the end user to format a message any way they like and include selected dynamic values in the message.
Subject: RE: Solved (sort of) - Message is not being formated correctly until client is resized.
The problem is, it isn’t really a “special code”. Rich Text is made up of a series of composite data records, also known as CD records (basically structures in memory crammed onto disk), and a text record has some initial information about the font, point size, etc., plus a length, and is followed by a string of characters. You can’t tell by looking whether the text record has changed, unless the font face changes, or the color changes, or the style changes, but the text record can change invisibly. In our Midas Rich Text LSX, we consolidate text records to avoid that problem, but I am fairly sure the standard LotusScript classes do not. An easy way to tell is to create with your agent and save with your agent, then see the size of the document from the view, then edit the document in the Notes client and select everything and paste it back in, then re-save. Now, look at the size of the document and it will have gotten smaller. That smaller size reflects the consolidated text records, but there were never any special codes or anything else to see.
By the way, this rich text field has 23 CD records, 7 of which are text records. How about that?