Alternate String Delimiters

Often a string literal in LotusScript will need to contain the quote character
("). Since this is the usual string delimiter, the embeded quote needs to be
handled correctly. Here are some different ways to display the string: Database
title is "Fish Sticks".
Dim session as New NotesSession
Dim db as NotesDatabase
Set db = session.CurrentDatabase

' 1) The escaped quote. Can be hard to see where
' the embedded quotes are and if there are enough of them.
Print "Database title is """ & db.Title & """."

' 2) The alternate delimiter. Allows embedded quotes
' and is easier to read with lees chance for error.
Print |Database title is "| & db.Title & |".|
' or, my favorite. . .
Print {Database title is "} & db.Title & {".}

' I like using braces as a string delimiter because the
' start ({) and end (}) characters are different. This, unlike
' the quote (") or pipe (|), makes it easy to see whrere
' the literal begins and ends. And embedded quotes
' are a snap to insert correctly.

Dig Deeper on LotusScript

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...