GetUnformattedText adds carriage returns!?

I am storing a very large text string in a rich text field so I can pass it from one web page to the next. I’m using rich text so I can exceed the storage limitations of a regular text field. Since all I want is the plain text, I’m using GetUnformattedText to extract the string and when I do that, it seems to add carriage returns! :frowning:

The pattern is this: I get a chunk of data 4096 characters long, a carriage return, then a chunk 3836 long, carriage return, then 4096 again, then 3852, 4096, 3863, 4096… etc.

Can anyone explain why this might be happening? It’s killing me.

Subject: RE: GetUnformattedText adds carriage returns!?

Haven’t tried this method, but it sounds like you’d best use GetFormattedText instead, with a large line length.

Subject: RE: GetUnformattedText adds carriage returns!?

So it turns out that when we’re writing the value to the richtext field is when this happens. We were saving a giant list of key values with no spaces at all and upon writing it to the rich text field we noticed the carriage returns were already there upon save. Grr…

I have no idea why this happens, but we found out that if we delimited the groups of key values by chr(13) instead of ~ then at least the extra carriage returns happened somewhere other than in the middle of a value.

So we have a working solution now but Lotus, if you’re listening… what the heck?

Subject: RE: GetUnformattedText adds carriage returns!?

Ah. You’re exceeding the maximum size of a paragraph and Notes is kindly inserting paragraph breaks for you.

If you don’t like where it inserts them, put in your own paragraph breaks now and then – instead of chr$(13), call rti.AddNewLine(1, true) at that point.

Subject: RE: GetUnformattedText adds carriage returns!?

I looked at http://www.geniisoft.com/showcase.nsf/DominoLimits and it claims to think 64k is my paragraph limit. I’m getting forced breaks at 8k (4096 characters). Not only that but it’s not consistantly 8k. The number of characters I find forced paragraph marks after are:

4096, 3836, 4096, 3852, 4096, 3863…

As you can see, every other one is a nice predictable 8k, but then the even blocks are randomly some amount less than 8k. I’m baffled by this whole thing but I’ll try your AddNewLine idea and see if the issue goes away. Thanks. :slight_smile: