Skip Navigation

About This Website

CodeStore is all about web development. Mostly with the Lotus Domino server.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

About This Page

Written by Jake Howlett on Tue 14 Mar 2006

Permalink: Tips Week 2.2 - Trimming Names in LotusScript

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Recent Comments

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

Tips Week 2.2 - Trimming Names in LotusScript

If you thought yesterday's tip was simple, check this out.

Have you ever written code of questionable quality like this?

FullName = doc.FirstName(0)

if doc.MiddleInitial(0) <> "" then
 FullName = FullName + doc.MiddleInitial(0)
end if

FullName = FullName + " " + doc.LastName(0)

I know I've been guilty of coding like this in the past. There must be an easier way to work out full names for users? Well, yeah, you can use FullTrim() to remove duplicate spaces and so the following would do just fine:

FullTrim( doc.FirstName(0)+ " " 
        + doc.MiddleInitial(0) + " " + doc.LastName(0))

More simple tips to follow...

Comments

    • avatar
    • Remko
    • Posted on Tue 14 Mar 2006 07:23 AM

    However when you use fulltrim in a scheduled agent on many many documents, this function causes a memory leak

    • avatar
    • Jake
    • Posted on Tue 14 Mar 2006 07:31 AM

    Really? Doh. The following would do too:

    Trim( doc.FirstName(0)+ " " + doc.MiddleInitial(0)) + " " + doc.LastName(0)

  1. Really -- in the R5 code stream (fixed in 5.0.9, if I recall correctly).

Add your own response here:

Although your email address isn't required it is protected from spambots if you choose to provide it and not to hide it. My right to remove commercial, irrelevant or posts I just don't like is reserved.

Name *:
E-mail:
Website:
 

Comment *:

HTML is not allowed!