Chapter 2 The DynaScript Language


Literals

Literals are fixed values in your scripts. For example, the following are literals:

Integers

Integers can be expressed as:

Floating-point numbers

A floating-point number can have:

Examples:

Booleans

The Boolean (logical) type can be true or false .

Strings

A string is zero or more characters enclosed in single (') or double (") quotes. You must use the same kind of quote (single or double) to start and end a given string.

Examples:

Control characters

You can embed the following control characters in strings:

Escaping characters

You can place quotes inside of strings by preceding them with a backslash (an escape character).

For example:

document.WriteLn("He played \"Stairway To Heaven\" at 78 RPM.")

would yield:

He played "Stairway To Heaven" at 78 RPM.

You can insert a backslash itself by using two backslashes (one as the escape character, one as the literal backslash).

 


Copyright © 1999 Sybase, Inc. All rights reserved.