One Line

| | Comments (3)

So we've spent *hours* on this problem. The problem of how to display a notes richtext field as html. For the most part the data we have is just plain text, but with carriage returns that don't render if you just display them (since carriage returns without <br> tags are ignored by browers). We looked at buying Midas. We tried using a mime conversion script we found on the web. Nothing was easy. And we were working with lotusscript which is messy at the best of times, and Jim didn't know off hand how to convert line breaks to <br> tags. So today I was thinking more about the problem because go-live is next week and we're still no closer to solving it. So I wondered how i could do what I wanted to do in formula language. And I solved a decent chunk of our problems with one line of code:

@ReplaceSubString(@Text(Body);@Newline;"<br>")

It was enough to make me want to give up and go home. Or at least drink and shoot people :)

3 Comments

YVonne said:

Drink?? Did some one mention drink??? Off next weekend......

September 3, 2005 12:57 AM

   

delmer said:

I'm curious ... did the fix come to you while you were at work? Or did it bounce into your head while you were doing something unrelated?

A lot of my solutions come to me while I'm taking a walk or showering. If I could just combine the two -- walking and showering -- I could probably solve all the world problems. Maybe it's time for a bathroom remodel.

September 3, 2005 2:46 AM

   

kazza said:

Next weekend sounds good :)

Delmer: nah was just trawling through help files, looking for ideas and commands I may not have thought to use. I saw the @replacesubstring (which I've actually used before), and one of the examples was how to do stuff with new lines. I knew was easy to add a new line, I just didn't know it would be easy to take them away with the same function :)

September 3, 2005 8:04 AM

   

Leave a comment

Kazza's "Boring Life Of a Geek" aka BLOG

IT geek, originally from Sydney, moved to Canberra in 2007. Married to "the sweetie", aka Stu. Prolific photographer, Lego junkie and tropical fish keeper.

Kazza the Blank One home