I’ve searched the Lotus 8 discussion database and haven’t seen this mentioned anywhere.
LotusScript appears to be adding a space to any string that ends in the character 1. I’m trying to generate a key to read a view with the following code:
exerciseKeys(0) = memberDoc.Fitness_Team(0)
exerciseKeys(1) = empName.Common
For w = 1 To weekNo
exerciseKeys(2) = "Week " & Cstr(w)
Set exerciseDoc = exerciseList.GetDocumentByKey(exerciseKeys, True)
’ Process record
Next
The record is never found because key(2) is "Week 1 " instead of “Week 1”.
Later in the same code I have this statement:
itmName = “Week” & Cstr(w + 1) & “_Made_Goal”
In this case itmName does NOT have the extra space.
I even tried to get around the problem by creating an array with the week numbers in it (“Week 1”, “Week 2”, etc.). When I view the array in debugger every entry that ends in a 1 has a space following the 1, even though it was coded as a literal without it.
I tried Trim(Cstr(w)) without any difference in the way the script interprets in the runtime mode. I also tried to set another string field to Cstr(w) and then do Left(string, 1). That also fails to remove the space. This appears to be a script interpreter problem.
For now I’m making a copy of the view with a special character after the week number to work around this problem.