What's wrong with "Evaluate"?

Hello, I caeated an agent Useing Evaluate, there is an error in coding below, Would you please tell me what’s wrong with str1 and str2?

Set doc = collection.GetFirstDocument()

Dim workspace As New NotesUIWorkspace

Dim picklist As Variant

Dim messagelist As String

picklist= workspace.PickListStrings( _

PICKLIST_CUSTOM, _

True, _

"Dom_Svr_1/Telesat/CASOC", _

"names.nsf", _

"People", _

"Name", _

"Please select some documents.", _

5, _

"" ) 



str1=Evaluate("@Right(picklis(0);"","" )" )

str2=Evaluate("@Left(picklist(0);"","" )" )

strT=str1 & " " & str2

     ...

Thanks,

Linda

Subject: What’s wrong with “Evaluate”?

Hi Linda,

Just to add to tricias response, you’ll find evaluate returns a variable of type string, so you’ll need to access the first element of str1 and 2. You also need to wrap the LS variable in quotes in the evaluate statement.

str2=Evaluate(|@Left(“| & picklist(0) & |”;“”,“” )|)(0)

Or you could just use strleft in LS-

strleft(picklist(0),“”)

HTH

Andrew

Subject: RE: What’s wrong with “Evaluate”?

Thanks Andrew, Tricia, and Bjorn. Strright is the simple one. It works fine.

Thanks for all of you!

Linda

Subject: “picklis” misspelled?

Subject: What’s wrong with “Evaluate”?

Hi Linda,

Just to add to tricias response, you’ll find evaluate returns a variable of type string, so you’ll need to access the first element of str1 and 2. You also need to wrap the LS variable in quotes in the evaluate statement.

str2=Evaluate(|@Left(“| & picklist(0) & |”;“”,“” )|)(0)

Or you could just use strleft in LS-

strleft(picklist(0),“”)

HTH

Andrew

Subject: “picklis” misspelled?

Subject: What’s wrong with “Evaluate”?

Hi Linda! Try replacing the following lines thusly - couch your formula in vertical bars rather than quotes:

str1=Evaluate(|@Right(picklis(0);“”,“” )| )

str2=Evaluate(|@Left(picklist(0);“”,“” )| )

Have fun!

Trish

P.S. Evaluate returns a variant if the formula being evaluated has a return value. You may have to catch this in a variant and then pass it to your string.

Subject: What’s wrong with “Evaluate”?

Why not use the StrRight, or StrLeft lotusscript functions instead?str1 = StrRight(picklist(0), |“,”|)

Also you can use Split if you have a known number of elements

arrTemp = split(picklist(0), |“,”|)

str1 = arrTemp(0)

Btw, the Evaluate should work if you do this:

str1 = Evaluate(|@Right(“|+picklist(0)+|”;“”,“”)|)

(Evaluate doesn’t understand your picklist(0) variable)

regards,

Bjorn

Subject: What’s wrong with “Evaluate”?

Why not use the StrRight, or StrLeft lotusscript functions instead?str1 = StrRight(picklist(0), |“,”|)

Also you can use Split if you have a known number of elements

arrTemp = split(picklist(0), |“,”|)

str1 = arrTemp(0)

Btw, the Evaluate should work if you do this:

str1 = Evaluate(|@Right(“|+picklist(0)+|”;“”,“”)|)

(Evaluate doesn’t understand your picklist(0) variable)

regards,

Bjorn