A text constant (see Constants) is a series of characters surrounded by quotes. When writing a text constant you may choose from six different types of quotes: Double Quotes, Single Quotes, Curly Braces, Smart Double Quotes, Smart Single Quotes, and Pipes.

Double Quotes — This is the most common quoting method. The embedded text begins with a " and ends with another ".

"January"

A possible complication is if you want to include the " character itself in the embedded text.

Suppose that you needed to use the text The shim was 6" high in a formula. Using double quotes around the constant will cause a grammar error, because Panorama will think that the embedded text ends after the second " character, and it won’t know what to do with the text high".

"The shim was 6" high"

One solution is put two double quotes in a row (as highlighted dark blue in the example below). Panorama will convert these into a single quote and continue with the text constant.

"The shim was 6"" high"

Another solution is to use a different type of quote (see below).

Some other programming languates solve this problem by using an escape character, usually a backslash. Panorama does not use escape characters in text constants.

Single Quote — The embedded text begins with a ' and ends with another ', like this.

'Tuesday'

You can use single quotes if you want to include a double quote in the embedded text.

'The shim was 6" high'

Curly Brace — The embedded text begins with a { and ends with }, like this.

{San Francisco}

Smart Double Quote — The embedded text begins with a and ends with , like this.

“Gothic”

Smart Single Quote — The embedded text begins with a and ends with , like this.

‘Bohemian’

Pipes — The embedded text begins with one or more pipe symbols | and ends with the same number of pipe symbols. For example, if the constant begins with ||| then it must end with |||, if it begins with ||||| it must end with |||||. Using the multiple pipes as quotes makes it easy to embed any other kind of character in the text constant:

|||last="Elliot" first="Suzette" address="892 Melody Lane"|||

You can even embed pipes within a piped constant, like this:

|||| language=javascript code=||alert("Hello World");|| ||||

As you can see pipe delimited constants are very handy for creating text constants that contain computer code.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0