Manage Learn to apply best practices and optimize your operations.

The Simplest LotusScript Version of @Explode

This is a very simple way to parse through a text string and separate it into a multivalue array.

Using a specific character as a separator, ";" for example, the code separates the string into a multiple elements of an array. In this example, the results are as follows:

FieldA = "value1;value2;value3"

FieldB(0) = "value1"
FieldB(1) = "value2"
FieldB(2) = "value3"

Code:
TempStr = FieldA 'Get string to parse.
'Can also be a single value field
j = 0
Redim NewArray(j)
For i = 1 To Len(TempStr)
' Parse group names into individual elements in an array
char = Mid(TempStr,i,1)
'Search for separating character--a semicolon for example
If char <> ";" Then
v NewArray(j) = NewArray(j) & char
Else
j = j+1
Redim Preserve NewArray(j)
End If
Next i

FieldB = NewArray 'New array of values

Dig Deeper on Domino Resources - Part 5

SearchWindowsServer
Search400
  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

SearchDataCenter
SearchContentManagement
Close