Crazy "" in my string

In my program I’m trying to build a search string to pass into a NotesDatabase.search(). The problem is that I need to have " around string literals in the search string and my code keeps blowing it up.

Here’s the code:

Let strSearchQuery = {Form = “AlternateRule” & AlternateName = “} & strCurrentActor & {” & ApplicationKey = “} & Me.getInstance().getApplication().getKey() & {”}

Here’s the result:

Form = ““AlternateRule”” & AlternateName = ““CN=User2 Development/OU=SNC/O=SNCorp”” & ApplicationKey = "“5B3E10B997BEBA6E88257553006AB521"”

See how every time there’s a " there is actually a double “”? I don’t want that. Is there an escape character in LotusScript? I wish I could just use a " instead of those {} brackets.

Any help would be appreciated.

Nick

Subject: “” is the escape

Double quotes means to print a literal quote. Normal for Lotusscript.

So the variable will contain (in debugger):

““AlternateRule”” & AlternateName = ““CN=User2 Development/OU=SNC/O=SNCorp”” & ApplicationKey = "“5B3E10B997BEBA6E88257553006AB521"”

but when you print it should show:

“AlternateRule” & AlternateName = “CN=User2 Development/OU=SNC/O=SNCorp” & ApplicationKey = “5B3E10B997BEBA6E88257553006AB521”

Subject: re: “” is the escape

Thanks Simon, I guess that means my problem is somewhere else. I keep getting a type mismatch when I place that string in the NotesDatabase.Search() function. Any ideas why this string might cause a type mismatch?

Nick

Subject: One idea: use [Form] if you talk about the field form

Actually you could surface your search formula into an Input box and copy it from there to the clipboard, and test it (and some changes) manualy untill perfect.

Subject: Things to look for.

Type mismatch normally means you are trying to search on a value that is not valid for that field. So if one of those is not a text field then you need to change it.

There is also an issue where duplicate field names in different forms are not searchable. This technote should detail it.

Title: Searching on a field in Notes fails when indexer does not recognize field data type
Doc #: 1261002
URL: http://www.ibm.com/support/docview.wss?rs=899&uid=swg21261002