Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 435
  • Last Modified:

Problem with Evaluate Function

I have written an Evaluate Function in Lotus Script, Syntax as
Dim a as variant
Dim b as variant
a=Evaluate({@Explode("UK,US,USSR")})
b=Evaluate({@Explode("GERM,UJ")})
Status=Evaluate({@contains(a,b)})  'Problem is in this line @contains not working
MsgBox "The value of Status= "&Status(0)

In the above example, The values in b are not matching with the values in a, so The result of variable Status should be "0", but it is showing as "1". could anyone please help me in this.
0
skancherla
Asked:
skancherla
  • 2
1 Solution
 
ArunkumarCommented:
Hi Sanjay !

I dont think you can use a variant to pass the value to an evaluate statement.

Try replacing the a and b with the actual explode statements instead of passing them thru a variables.

Good Luck !

-Arun
0
 
skancherlaAuthor Commented:
if i write like this

ReportStatus=Evaluate({@contains(@Explode("UJ,UK,GERM");@Explode("US,USSR,GERM"))})

            it will work fine

But actually what is required is,  Variables  a  &  b will contain the Document field values. for example,

          a=doc.country1(0)
          b=doc.country2(0)

for doing above, i have to use variables a and b in the below code as
        Status=Evaluate({@contains(a,b)})

by doing so, it is not working. i tryied using a and b with different data types like string & variant.But no result! if you have any better idea please let me know.
Your help is Appreciated men!!
0
 
ArunkumarCommented:
Hi Sanjay,

Dim session As New notessession
     Dim db As notesdatabase
     Dim view As notesview
     Dim doc As notesdocument
     Set db=session.currentdatabase
     Set view=db.getview("Test1")
     Set doc=view.getfirstdocument
     Dim a,b As String
     Dim formula As String
     Dim status As Variant
'if i write the statement like this
     
ReportStatus=Evaluate({@contains(@Explode("A,B");@Explode("C,D"))})
     Msgbox ReportStatus(0)
'it will work fine
'But actually what is required is,  Variables  a  &  b will contain the
Document
'field values. for example,
     a=doc.country1(0)
     b=doc.country2(0)

'for doing above, i have to use variables a and b in the below code as

'************************************************************
' My change is made here where i have included a String variable
'called as formula and built it. And Evaluate that formula
'************************************************************
     formula = |@Contains(@Explode("| & a & |") ; @Explode("| & b & 
|"))|
     Status=Evaluate(formula)
     Msgbox "The value of status..."& Status(0)

Good Luck !

-Arun

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now