Solved

Problem with Evaluate Function

Posted on 2000-04-26
3
418 Views
Last Modified: 2013-12-18
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
Comment
Question by:skancherla
  • 2
3 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 2753884
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
 

Author Comment

by:skancherla
ID: 2756817
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
 
LVL 9

Accepted Solution

by:
Arunkumar earned 11 total points
ID: 2761107
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now