LOTUSSCRIPT LANGUAGE


Deftype statements
Example

Set the default data type for variables, functions, and properties whose names begin with one of a specified group of letters.

Note DefBool and DefByte are new with Domino Release 6.

Syntax

DefBool range [, range] ...

DefByte range [, range] ...

DefCur range [ , range ] ...

DefDbl range [ , range ] ...

DefInt range [ , range ] ...

DefLng range [ , range ] ...

DefSng range [ , range ] ...

DefStr range [ , range ] ...

DefVar range [ , range ] ...

Elements

range


Usage

The following table lists the Deftype statements, the data type that each one refers to, and the data type suffix character for that data type.

StatementData typeSuffix character
DefBoolBoolean(none)
DefByteByte(none)
DefCurCurrency@
DefDblDouble#
DefIntInteger%
DefLngLong&
DefSngSingle!
DefStrString$
DefVarVariant(none)
Deftype statements can only appear at the module level, but they affect all declarations contained within the module at module level and within its procedures. They do not affect the declarations of data members of types and classes. They do affect declarations of function members and property members of classes.

All Deftype statements in a module must appear before any declaration, explicit or implicit, in the module. Exception: the declaration of a constant (by the Const statement) is not affected by Deftype statements.

No range in any Deftype statement can overlap any other range in the same Deftype statement or in any other Deftype statement in the same module.

The range A-Z is special. It includes all international characters, not only the letters with ASCII codes less than 128. It is the only range specification that includes international characters. For example, to change the default data type of all variables, functions, and properties to Single (the standard data type for several versions of BASIC), specify DefSng A-Z.

Declarations that are explicit as to data type (such as Dim X As Integer, Dim Y$, or Define MyFunction As Double) take precedence over Deftype declarations.

Example
See Also