In an application that I am developing I need to generate a text string that looks like this:
“VarOne” : “VarTwo” : “VarThree” : etc
The LS I’m using is as follows:
For X = 1 To 20
Obj = Pdoc.GetItemValue("ReadObject_" + Cstr(X))(0)
If Not(Obj = "") Then
If X = 1 Then
ReadObjects = Obj
Else
ReadObjects = ReadObjects + " : " + Obj
End If
End If
Next
WHen I’m finished the variable ReadObjects in the Debugger looks like this:
“VarOne : VarTwo : VarThree”
I have tried every combinations of " | that I can think of and always end up with the ReadObjects looking like this in the debugger:
“”“VarOne”" : ““VarTwo”” : ““VarThree””"
What I am trying to end up with is a string that I can use to modify a Selection formula so that it will look something like this
For X = 1 To 20
Obj = Pdoc.GetItemValue("ReadObject_" + Cstr(X))(0)
If Not(Obj = "") Then
If X = 1 Then
ReadObjects = Obj
Else
If X = 2 Then
ReadObjects = ReadObjects & {"} & { : "} & Obj & {"}
Else
ReadObjects = ReadObjects & { : "} & Obj & {"}
End If
End If
End If
Next
Formula = Part1 + {"} + ReadObjects + ");"
vw.SelectionFormula = Formula
It still not fully ready for production but I’m on the right track now.
Again BIG thanks!!! The small problems are always the hardest to figure out.
Don’t create a string value. Create a dynamic array and populate it as you loop. Then set a multi-value field value with the array result and use that fieldname as your list field in the @ismember formula.
Subject: RE: Getting a proper formated string in LS
The problem is the values are in a profile document that the user enters then I need to change the Selection formula accordingly. I was able to resolve the problem with a little help from my friends in the forum here. See my solution: