HP DDL D40 Reference Manual page 60

Data definition language
Table of Contents

Advertisement

Named Constants
If you use the version number for a comparison check with other version numbers, you
can use the number as is. If you need to decode the number to determine the specified
release, do this:
Obtain the letter of the release by dividing the number by 256. The quotient is the
ASCII decimal representation of the uppercase letter; any remainder is ignored.
Obtain the number of the release by multiplying this ASCII decimal representation
of the uppercase letter by 256 and subtracting the answer from the version
number.
For example, given the version number 17162, you can determine the release number
as follows:
17162 divided by 256 = 67.04
67 is the ASCII decimal representation for the letter C
67 multiplied by 256 = 17152, and 17162 - 17152 = 10
C10 is the release
Existing Constant Guidelines
The following points are guidelines for using the name of an existing constant as the
value in a CONSTANT statement:
You can specify a DDL constant name instead of a literal value in the VALUE
clause of a CONSTANT statement whether the constant name identifies a string
constant, a numeric constant, or a version constant.
When the name identifies a previously defined string constant, the new value is
identical to the value of the string constant.
When the name identifies a previously defined version constant, the new value is
identical to the value of the version constant.
When an existing numeric constant is named in the definition of another DDL
numeric constant, certain rules apply:
If the CONSTANT statement does not include a TYPE clause, the constant
being defined inherits the type of existing-constant.
If the CONSTANT statement has a TYPE clause, its specified type overrides
the type of existing-constant.
If a TYPE clause in the CONSTANT statement overrides the type of
existing-constant, the value of existing-constant must be consistent
with the specified type.
Data Definition Language (DDL) Reference Manual—426798-002
4 -4
CONSTANT Statement

Advertisement

Table of Contents
loading

Table of Contents