Chapter 2 The DynaScript Language
Literals are fixed values in your scripts. For example, the following are literals:
123
, 0x3F
, 0123
(integers)
456.789
, 3.2e-8
(floating-point
numbers)
true or false
(Boolean)
"The rain in
Spain" (string)
Integers can be expressed as:
189
0123
0x3F
A floating-point number can have:
Examples:
The Boolean (logical)
type can be true
or false
.
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:
You can embed the following control characters in strings:
\b
backspace
\f
form
feed
\n
new
line
\r
carriage
return
\t
tab
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. |