Back Forward How to enter constants in expressions

An expression may consist of only a constant — also called a literal value — or can include constants, operators, property references and functions.

Use these guidelines to enter constants. The value you type may depend on the Type of the property. Include all quote characters as shown. (Don't use Microsoft Word Smart Quote characters; use only the ASCII double quote character " to identify constants.)

Type

Instructions

Example

TrueorFalse

Enter "true" or "false" or "T" or "F."

In most cases, such properties appear as a check box on radio buttons. Avoid the null value "" for a TrueOrFalse property; in many but not all settings, it is the same as "false".

"true"

Text

Enter two double quotes for the null string.

For normal text, enter printable characters (other than double quotes) between two double quotes. You can include single quotes within the double quotes.

Use the two character sequence /" to include a double quote.

Use Java character escapes to include tab characters (/t), backspace (/b), newline (/n), form feed (/f), carriage return (/r), backslash (//), and /zzz for the Latin-1 character identified by the octal value zzz, between 000 and 377.

""
"Hello World"
"It's a beautiful day"
"Make/tmy/tday."

Identifier

Enter only letters or digits. By convention, start the value with an uppercase letter. Do not use quotes.

MarketPrice
ProductID

Integer

Enter digits 0-9 and an optional plus or minus sign. Do not include commas or a decimal point.

Enter pairs of hex digits (0 to F) preceded by 0x. for a hexadecimal value.

-443
1
432329894
0xFFF4
0x143F871A
014371

Decimal

Enter any number of decimal digits, a single comma or period, and additional decimal digits. Don't include more than one punctuation mark. Don't start a value with a period; use a leading zero.

437.1
3.14159

Password

Use any non-blank printable character. Don't include spaces or control characters. Case is significant.

4X9KK6u

Date

When a date constant appears alone in an expression, include double quotes to prevent the value from being interpreted as an integer.

Enter two or four digits for the year, two digits for the month, two digits for the day.

If the year contains two digits, the system uses an algorithm to determine a "reasonable" century based on the current date. During 2006, the system prefers dates between 1997 and 2097.

The valid expression

12/10/2006

is an expression involving two divisions and three integers, whereas

"12/10/2006"

is an American-style date.

The empty string and "" are equivalent to "19700101" or January 1, 1970. In settings where this is not desirable, processing can test for and block this date value.

"19990512"
"20021231"
"990101"

Double

Enter an optional sign, digits, decimal point, digits, the letter E and an exponent. All parts of the literal are optional except for the decimal point and one digit.

123.45
0.04
6.02E23

DateTime

Enter a value using this pattern: yyyyMMddtHHmmss.SSS zzz. Enter:

  • Two or four digits for the year
  • Two digits for the month
  • Two digits for the day
  • The single T (or t or period . or comma ,)
  • Two digits for the hour
  • Two digits for the minutes
  • Two digits for the seconds
  • A period
  • Three digits for the milliseconds
  • One space
  • The literal GMT for the zone.

The year, month, and day are required.

Separate the date and time portions of the value with either T, t, a single space, or a punctuation mark such as a period or a comma.

If you include milliseconds, separate the seconds from the milliseconds with either a period (.) or a comma (,). Use the GMT time zone only.

The time portion is optional. If you omit the time portion, follow the guidelines above for Date constants, by enclosing the value within parentheses.

If the year contains only two digits, the system uses an algorithm to determine a "reasonable" century based on the current date. During 2007, the system prefers dates between 1998 and 2098.

20060415T115959.123 GMT

Time of Day

Enter two digits for the hour, from 00 to 23. Optionally, enter two digits for the minute, from 00 to 59. If you include six digits, the system interprets the last two as seconds. You can include an optional colon to separate the segments of this value. Do not enter a time zone.

000000 for midnight
12:00:00 for noon
23:59:59 for one second before midnight

Definitions Type
Related topics About Model rules

zzz About expressions