PermaLink Know your Trim's11/11/2008 10:17 AM
LotusScript
I recently needed to convert some LotusScript code that used Trim() to formula code. The reason for this was so that the code will be run when I use NotesDocument.ComputeWithForm. Here's a sanitized version of the LotusScript code:

Sub Initialize Dim pre As String Dim fst As String Dim mdl As String Dim lst As String Dim suf As String Dim username As String Dim username2 Dim nameStr As String pre = "" fst = "Michael" mdl = "" lst = "Sobczak" suf = "" username = Trim$(pre & " " & fst & " " & mdl & " " & lst & " " & suf) End Sub
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


The above code uses the Trim() function. Trim() doesn't remove redundant spaces between words, so the result is that my name has two spaces between my first name and last name, like this: "Michael Sobczak". Here's the formula version of the same code:

pre := "";
fst := "Michael";
mdl := "";
lst := "Sobczak";
suf := "";
username := @Trim(pre + " " + fst + " " + mdl + " " + lst + " " + suf);
@Return ( username );

The @Trim() function removes all redundant spaces between words. So now my name has only one space between my first name and last name, like this: "Michael Sobczak" Why is this a big deal? Well, the form in question logs individual field changes to the document history section. When the above formula runs in the Input Translation event, the username is recomputed and the form sees the field value as having changed and logs the change. So the only solution I can think of is to run some cleanup code against all of the existing documents to fix the original problem introduced by Trim(). If only the original Lotusscript code had used FullTrim()...
Comments :v

1. Moncler Hoody Women10/24/2011 01:39:21 AM
Homepage: http://www.celebsmoncler.com/


I usually had <a href="{ Link } Kinder</strong></a> worn a t-shirt inside, and a Moncler jacket <a href="{ Link } polo Hemd</strong></a> outside, that make me feel very <a href="{ Link } Moncler polo Hemd</strong></a> fresh. And also sometimes <a href="{ Link } Moncler hoody</strong></a> when I went inside, moncler shops <a href="{ Link } Moncler Pullover</strong></a> moncler branson moncler <a href="{ Link } Schal &Hut</strong></a> doudoune I just wear a t-shirt, that is <a href="{ Link } Herren Moncler Schuhe</strong></a> enough.




Credits
NuTechs Powered by Domino
Search
Calendar
February 2012
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Monthly Archive
Get Real, Detroit!
Real Detroit Weekly
SWARM
Service
With
A
Rapid
Motion


-- old Rally's Hamburgers credo
Lotus Domino ND6 RSS News Feed RSS Comments Feed Podcast Feed Geo URL netcraft RSS Validator Lotus Geek Chris. A. Brandlehner Open Notes Picture Database OpenNTF CoComment Integrated BlogSphere
By Category
The BlogRoll
About
Contact Me
Contact me, Michael Sobczak, using this e-mail address:

my first initial my last name at Yahoo dot com
Recent Entries
No Recent Blogs
Powered by
Blogsphere