ESCR Program and Callable System

Last updated 28 February 2021


Data Types

Each explicit constant, symbolic constant, variable, and function value has a data type. These data types are referred to by name, and are listed below together with their descriptions. The data type names are keywords, and are therefore case-insensitive. The data types are:

BOOL

A value of this type is always either TRUE or FALSE. TRUE and FALSE are built in keywords, and are case-insensitive.

The default value for this data type is FALSE.

INTEGER

An integer value. Its string representation is:

[-][radix#]number

Where radix is the radix represented in decimal. Radix must be from 2 to 36, with the default being 10 (ten). Number is the integer number in the specified radix. The letters A-Z or a-z are used for digit values from 10-35. Each digit value must be less than the radix.

For example, each of the following has the value of 143 in decimal:

143
10#143
16#8F
8#217
2#10001111

Integer values are written in decimal by the ESCR system unless this is overridden by specific formatting.

The default value for this data type is 0.

REAL

This data type is also sometimes called floating point in descriptive text. The string representation is a consecutive string of decimal digits containing exactly one decimal point before, within, or after it. This string may be optionally followed by "E" and an exponent value. This is all interpreted as you would expect if you've used a computer since the late 1950s.

Floating point values are written with 7 significant digits by ESCR unless this is overridden by specific formatting.

The default value for this data type is 0.0.

STRING

A string constant is a sequence of characters enclosed in a pair of quoted string start/end characters. These start and end characters can be set by the application. The ESCR default is quotes ("...") or apostrophies ('...').

The value is the characters between but not including the quote start/end characters To include the ending quote character literally in a string, it must be written twice consecutively. This only applies to the end-quote character used for the specific string. For example, both these string have the same value (assuming default ESCR syntax):

"Don't say ""never""."
'Don''t say "never".'

The dictionary collating sequence is used for string comparisons of letters and decimal digits. A string is less than another string if it would be listed earlier in a dictionary according to these rules. Upper case letters are immediately less than their lower case counterparts. The digits 0-9 are less than all letters. If two strings of different length are compared that are equal up to the length of the shorter string, then the shorter string is less than the longer string. The space character is less than all other printable characters.

The collating sequence is not defined for characters other than space, the digits 0-9, and the upper and lower case letters A-Z. The results for the remaining characters will be consistent on any one implementation, but are not guaranteed to be consistent accross implementations.

As an example, the following strings are listed in less than to greater than order:

"aB" "ab" "cd" "cde" "cde f" "cdef" "def22" "defaa"

The default value for this data type is the empty string.

TIME

Values of this data type specify an absolute time. The time is stored internally in 60.30 bit fixed point universal coordinated time seconds with zero at the start of year 2000. This data type therefore has a resolution of about 931 picoseconds, and a range of about ±15 billion years.

The text representation of this data type is:

YYYY/MM/DD.hh:mm:ss.ssssss

This is the text representation produced by the ESCR system when a time value is implicitly converted to text. Hours are always written in 24 hour format, so there is no AM/PM indicator. When converting to a TIME data type from the text representation, trailing fields may be omitted after the first slash. Omitted fields will be assumed to have the value 0. For example, all the following text time representations indicate 2:00pm on Monday 23 October 2006:

2006/10/23.14
2006/10/23.14:00
2006/10/23.14:00:00

When TIME values are compared, eariler times are considered less than later times.

The default value for this data type is the start of year 2000.