Hello.
I am working on a piece of code that is part of a larger script that grabs data from a Notes Db, manipulates it and sends it to a disparate system. There is a new requirement that has me stumped, and hopefully someone can provide assistance.
I have two separate text fields (arrays) whose values are separated by the “|” symbol. For my code, the fields are dependent on each other for data later in the code. The elements in each array are always the same, meaning if field1 has five elements in the array, field2 always has five elements as well.
The issue is field1 can have duplicate entries, and I’m having a problem matching the duplicate entries (which should only count as 1 entry) with the corresponding entries in field2.
An example of my code is here:
dim sess as new notessession
dim db as notesdatabase
dim doc as notesdocument
dim fldcombo list as string
c1cnt =0
if doc.hasitem(“field1”) then
c1 = doc.field1(0)
if c1 <> “” then
eformulaC = |@explode(field1; “||”)|
evalC = evaluate(eformulaC, doc)
eformulaS = |@explode(field2; “||”)|
evalS = evaluate(eformulaS, doc)
forall y in evalC
if y <> “” then
x = evalS(c1cnt)
fldcombo(c1cnt) = y & “|” & x
msgbox fldcombo
c1cnt = c1cnt + 1
x = “”
end if
end forall
end if
end if
if I put a msgbox on the fldcombo line, it displays the content of the arrays (field1 and field2) like this, which shows me that it is getting a handle on the values:
QUE1104|US-1234
QUE1105|US-1235
QUE1104|US-1234
QUE1106|US-1236
QUE1105|US-1235
(the values on the left correspond to field1, and the values on the right are field2)
Every duplicate entry on the left (QUE1104 for example), needs to be matched up with all of its corresponding entries on the right, like this:
QUE1104 = US-1234, US-1234
QUE1105 = US-1235, US-1235
QUE1106 = US-1236
This is where any help would be appreciated. Thanks for your help.